Skip to content

Commit 0121c7e

Browse files
committed
Merge branch 'release/2.3.0'
2 parents c318d9d + 47533e3 commit 0121c7e

File tree

112 files changed

+692
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+692
-122
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
CliTools Changelog
22
==================
33

4+
next - UPCOMING
5+
------------------
6+
7+
8+
2.3.0 - 2016-01-26
9+
------------------
10+
- Updated compile documentation
11+
- Improved compile scripts
12+
- Added rsync.opts documentation
13+
- Added rsync.opts section in `clisync.yml` for additional rsync options
14+
- No terminal title if stdout redirect is detected
15+
- Added `docker:cleanup` for cleanup of orphaned images and volumes
16+
- Renamed `sync:server` to `sync`
17+
- Renamed `sync:backup` to `share:backup`
18+
- Renamed `sync:restore` to `share:restore`
19+
- Renamed `sync:deploy` to `deploy`
20+
- Added `COMPOSER=custom.json ct php:composer` support
21+
- Support for new PHP and TYPO3 Docker Boilerplate (with APPLICATION_USER detection, configurable)
22+
423
2.2.0 - 2015-08-19
524
------------------
625
- Introduced `docker:up --switch` (`docker:up` without --switch parameter no longer shutdown previous one)

Documentation/ALIASES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ alias dcroot='ct docker:root'
2222

2323
# Execute predefined cli in docker container
2424
alias dccrun='ct docker:cli'
25+
alias dcrun='ct docker:cli'
2526

2627
# Run command
2728
alias dcexec='ct docker:exec'

Documentation/COMMANDS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ All log commands are using a grep-filter (specified as optional argument)
7777
| | __ct mysql:restore typo3 dump.sql.xz__ -> xz'ed (lzma'ed) sql dump |
7878
| | __ct mysql:restore typo3 dump.sql --filter=typo3__ -> No TYPO3 cache tables in dump |
7979
| ct mysql:restore | Create (and drops if already exists) a database and restore from a dump |
80-
| | Dump file can be plaintext, gziped, bzip2 or lzma compressed |
80+
| | Dump file can be plaintext, gzip, bzip2 or lzma compressed |
8181
| | and will automatically detected |
8282
| | __ct mysql:restore typo3 dump.sql.bz2__ |
8383
| ct mysql:convert | Convert character set and collation of a database |

Documentation/Examples/clisync.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ GLOBAL:
5353
# set target as sub directroy (will be appended to working directory)
5454
workdir: ""
5555

56+
# Additional options ("-rlptD --delete-after --progress --human-readable" is already set)
57+
opts: ""
58+
5659
# exclude list/patterns for files and directories
5760
exclude:
5861
# Temp files
@@ -61,9 +64,7 @@ GLOBAL:
6164

6265
# VCS
6366
- ".git*"
64-
- ".gitignore"
65-
- ".gitmodules"
66-
- ".svn"
67+
- ".svn*"
6768

6869
# Build files
6970
- "composer.json"

Documentation/INSTALL.md

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
q[<-- Back to main section](../README.md)
1+
[<-- Back to main section](../README.md)
22

33
# Installation
44

@@ -17,8 +17,13 @@ q[<-- Back to main section](../README.md)
1717
- sudo
1818
- moreutils (ifdata)
1919
- coreutils (grep, sort, uniq, awk, cat, df, ip, cut, lsb_release, wall)
20+
- rsync (to prevent bugs with umlauts while you have to use rsync with version >= 3.0 (GNU version))
21+
- gnu-sed
2022
- docker and docker-compose (if you want to use docker)
2123
- mysql (if you want to use mysql)
24+
25+
When you're want to using clitools under OSX, you could use homebrew, an excellent package manager
26+
to easily install the above mentioned requirements.
2227

2328

2429
## Install clitools
@@ -36,37 +41,9 @@ wget -O"$HOME/.clitools.ini" https://github.com/webdevops/clitools/blob/develop/
3641

3742
## Aliases
3843

39-
Now you can use following aliases (some aliases requires clitools 1.8.0!):
44+
Now you can use some useful aliases (some aliases requires clitools 1.8.0!):
4045

41-
```bash
42-
# Shortcut for auto-tree-searching make
43-
alias make='ct make'
44-
45-
# Shortcut for auto-tree-searching make
46-
alias composer='ct php:composer'
47-
48-
# Shortcut for docker-compose (autosearch docker-compose.yml in up-dir, you don't have to be in directory with docker-compose.yml)
49-
alias dcc='ct docker:compose'
50-
51-
# Startup docker-container (and shutdown previous one, v1.9.0 and up)
52-
alias dccup='ct docker:up'
53-
alias dccstop='ct docker:compose stop'
54-
55-
# Enter main docker container (as CLI_USER if available - if not specified then root is used)
56-
alias dcshell='ct docker:shell'
57-
alias dcsh='ct docker:shell'
58-
59-
# Enter main docker container (as root)
60-
alias dcroot='ct docker:root'
61-
62-
# Execute predefined cli in docker container
63-
alias dccrun='ct docker:cli'
64-
alias dcrun='ct docker:cli'
65-
66-
# Execute mysql client in docker container
67-
alias dcsql='ct docker:mysql'
68-
alias dcmysql='ct docker:mysql'
69-
```
46+
[Example aliases for clitools](ALIASES.md)
7047

7148
## Configuration
7249

@@ -135,9 +112,12 @@ cd clitools
135112
make all
136113
```
137114

115+
### Details about the Makefile
138116
If you take a look into the `Makefile`, you will see which tasks have been executed.
139117
The steps are:
140118

141119
1. Execute composer command
142120
2. Start main build script
143121
3. Copy the previously built phar file to `/usr/local/bin`, so that you can execute clitools just by typing ct.
122+
123+
*Note*: If you're compiling clitools in OSX the easiest thing is to install requirements with homebrew: `brew install coreutils g-sed homebrew/php/box`

Documentation/USAGE-DOCKER.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Docker creation
66

7-
You can easly create new docker instances (from my or a custom docker boilerplate) also with code intalization
7+
You can easily create new docker instances (from my or a custom docker boilerplate) also with code initialization
88
and Makefile running.
99

1010
```bash
@@ -14,6 +14,9 @@ ct docker:create foobar
1414
# Create and start new docker boilerplate into foobar directory
1515
ct docker:create foobar --up
1616

17+
# Create new typo3 docker boilerplate
18+
ct docker:create foobar --docker=typo3
19+
1720
# Create new custom docker boilerplate
1821
ct docker:create foobar --docker=git...
1922

@@ -29,8 +32,8 @@ ct docker:create foobar --code=git... --make=build --up
2932

3033
## Docker startup
3134

32-
The `docker:up` command will search the `docker-compose.yml` in the current parent directroy tree and
33-
execute `docker-compose` from this directroy - you don't have to change the current directroy.
35+
The `docker:up` command will search the `docker-compose.yml` in the current parent directory tree and
36+
execute `docker-compose` from this directory - you don't have to change the current directory.
3437

3538
Also the previous docker instance will be shut down to avoid port conflicts.
3639

@@ -42,7 +45,7 @@ ct docker:up
4245
## Custom docker commands
4346

4447
As `docker:up` the `docker:compose` will search the `docker-compose.yml` and will execute your command
45-
from this directroy.
48+
from this directory.
4649

4750
```bash
4851
# Stop docker instance
@@ -83,7 +86,7 @@ ct docker:exec ps
8386

8487
You can define a common CLI script entrypoint with the environment variable CLI_SCRIPT in your docker containers.
8588
The environment variable will be read by `ct docker:cli` and will be executed - you don't have to jump
86-
into your containers, you can start your CLI_SCRIPTs from the outide.
89+
into your containers, you can start your CLI_SCRIPTs from the outside.
8790

8891
```bash
8992
# Execute predefined cli command with argument "help" in "main" container
@@ -105,3 +108,21 @@ ct docker:sniff http --full
105108
# Show mysql querys by using network sniffer
106109
ct docker:sniff mysql
107110
```
111+
112+
## Docker cleanup
113+
Docker currently doesn't cleanup orphaned images or volumes so you have to cleanup your system regularly to get free disk space
114+
115+
```bash
116+
ct docker:cleanup
117+
```
118+
119+
It's a shortcut for:
120+
121+
```bash
122+
# Docker image cleanup:
123+
docker images | grep "<none>" | awk "{print \$3}" | xargs --no-run-if-empty docker rmi -f
124+
125+
# Docker volume cleanup
126+
docker pull martin/docker-cleanup-volumes
127+
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
128+
```

Documentation/USAGE-MYSQL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ct mysql:list
1717

1818
# Debugging
1919

20-
The `ct mysql:querylog` and `ct mysql:slowlog` provides a convinent way to access the general query log
20+
The `ct mysql:querylog` and `ct mysql:slowlog` provides a convenient way to access the general query log
2121
and the slow log.
2222

2323
In the query log you can see all queries send and executed by the MySQL database.
@@ -67,7 +67,7 @@ Also the compression is automatically detected by file mime type.
6767
ct mysql:restore typo3 dump.sql
6868
```
6969

70-
# Datbase charset conversion
70+
# Database charset conversion
7171

7272
```bash
7373
# Convert database to UTF8

Documentation/USAGE-PHP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Composer (auto searching in path tree)
66

7-
Because you always need to jump into `composer.json` directroy `ct php:composer` will do this for you
7+
Because you always need to jump into `composer.json` directory `ct php:composer` will do this for you
88

99
```bash
1010
# Run composer install task

Documentation/USAGE-SYNC.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ First you need to create a `clisync.yml` in your project directory, the CliTools
1111
of this file by using following command:
1212

1313
```bash
14-
ct sync:init
14+
ct sync-init
1515
```
1616

1717
If you need special SSH settings (ports, compression, identify...) please use your `~/.ssh/config` file
@@ -30,59 +30,78 @@ Now you can sync your `production` server to your local installation:
3030

3131
```bash
3232
# Full sync (files and database, with interactive context selection)
33-
ct sync:server
33+
ct sync
3434

3535
# Only MySQL (from production context, without interactive context selection)
36-
ct sync:server production --mysql
36+
ct sync production --mysql
3737

3838
# Only Files (from production context, without interactive context selection)
39-
ct sync:server production --rsync
39+
ct sync production --rsync
4040
```
4141

42-
## Project sharing (ct sync:backup and ct sync:restore)
42+
## Project sharing (ct share:backup and ct share:restore)
4343

4444
The sharing can be used to share files (assets) and databases between developers.
4545
Please use a common development/storage server with ssh access for each developer for this feature.
4646

4747
```bash
4848
# Make backup of current state and transfer to share server
49-
ct sync:backup
49+
ct share:backup
5050

5151
# ... only MySQL
52-
ct sync:backup --mysql
52+
ct share:backup --mysql
5353

5454
# ... only files
55-
ct sync:backup --rsync
55+
ct share:backup --rsync
5656

5757
# Restore to state from the share server
58-
ct sync:restore
58+
ct share:restore
5959

6060
# ... only MySQL
61-
ct sync:restore --mysql
61+
ct share:restore --mysql
6262

6363
# ... only files
64-
ct sync:restore --rsync
64+
ct share:restore --rsync
6565

6666
```
6767

6868
## Lightweight deployment (ct sync:deploy)
6969

7070
With `sync:deploy` you can push your files to your production servers.
7171
Please keep in mind that this feature is just an wrapped rsync and should only be
72-
the simplest solution for deployment. For more advanced or centralized deployemnt try
72+
the simplest solution for deployment. For more advanced or centralized deployment try
7373
solutions build on Jenkis, Ansible and others.
7474

7575
```bash
7676
# Push your project to your servers (with interactive context selection)
77-
ct sync:deploy
77+
ct deploy
7878

7979
# Push your project to your staging server (without interactive context selection)
80-
ct sync:deploy staging
80+
ct deploy staging
8181
```
8282

83+
## Rsync additional options (rsync.opts)
84+
85+
The rsync options `-rlptD --delete-after --progress --human-readable` are automatically added when using the sync
86+
features of clitools. In addition, it is possible to set more options by adding them via `rsync.opts` (available since
87+
version 2.3 of clitools). In the following example the option `--iconv=UTF8-MAC,UTF8` is added to enable rsync filename
88+
charset conversion between local and remote file system. You need this especially when using rsync between hosts where a
89+
charset conversion on filenames is necessary (see `man rsync` for further details; e.g.: you probably need this when
90+
you sync between mac and linux utf-8 filesystem).
91+
92+
```
93+
...
94+
# Enable filename charset conversion where local is UTF8-MAC (Mac OSX) and remote is UTF8 (e.g. Linux)
95+
rsync.opts: "--iconv=UTF8-MAC,UTF8"
96+
...
97+
```
98+
99+
If you run into problems with `--iconv` make shure you have a compatible version of rsync >= 3.0 (as already mentioned
100+
in the [install section](INSTALL.md) of this documentation).
101+
83102
## Advanced ssh options
84103

85-
If you need some advaned ssh options (eg. other ports) use your `~/.ssh/config` configuration file:
104+
If you need some advanced ssh options (eg. other ports) use your `~/.ssh/config` configuration file:
86105

87106
Host project-server
88107
Hostname project-server.example.com

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ install:
99
autoload:
1010
sh -c "cd src ; composer dump-autoload --optimize --no-dev"
1111

12+
update:
13+
sh -c "cd src ; composer update"
14+
1215
sloccount:
1316
sloccount src/app/ src/command.php

0 commit comments

Comments
 (0)