Wallogit.com
2017 © Pedro Peláez
Bootstrap your local environment using docker containers & git, (*1)
git@example.com:vendor/crane-project
Install crane on your local machine using composer., (*2)
$ composer global require 'mlebkowski/crane:dev-master'
The binary will be put in ~/.composer/vendor/bin/crane, (*3)
Add project configuration:, (*4)
$ crane project:init git@example.com:vendor/crane-project
Edit the ~/.crane/config.json to set up the targets/current-target, (*5)
This is only required once per target. Docker images will be built from Dockerfiles., (*6)
$ crane image:build vendor/project-name --verbose
If something changes or goes wrong, you may want to use the --rebuild flag., (*7)
Launch all containers., (*8)
$ crane project:start vendor/project-name --verbose
Use --restart if something is wrong or images have changed. The main image is always restarted regardless., (*9)
You may want to bootstrap your app in some way (init the database, setup permissions, etc). Crane is application agnostic, so it does not have any build in mechanism. Id does however provide a project:command command. It will SSH into the running container (if 22 port is exposed inside) using the identity file as a private key., (*10)
To run a bootstrapping command on the main container, for example:, (*11)
$ crane project:command vendor/project-name 'phing -verbose -f /home/main-image-name/build.xml install' --verbose
Make sure you have agent forwarding setup for target host. All SSH commands are using the -A flag., (*12)
You may want to edit the application source files. To do this push to any branch at ssh://current-target/.crane/vendor-name/project-name/volumes/main-image-name. There is a post-receive hook there that resets the working copy to the pushed commit., (*13)
You might as well use sshfs, but there are cache’ing and performance issues. YMMV., (*14)