Deployment script.
deploy [--dry-run] [--update-db] [--restart-worker="..."] version [path]
Arguments:
version Which version to deploy (tag or branch name).
path Path to deploy the application into. Default is the current directory. (default: "C:\\dev\\deploy")
Options:
--dry-run If set, do not run any command. This is appropriate for testing.
--update-db If set, 'build update' will be run and the DB will be updated. If not, the user will be asked.
--no-update-db If set, 'build update' will *not* be run. If not, the user will be asked.
--restart-worker If set, the given Gearman worker will be restarted. If not, the user will be asked.
--no-restart-worker If set, the given Gearman worker will *not* be restarted. If not, the user will be asked.
--help (-h) Display this help message.
--quiet (-q) Do not output any message.
--verbose (-v) Increase verbosity of messages.
--version (-V) Display this application version.
--ansi Force ANSI output.
--no-ansi Disable ANSI output.
--no-interaction (-n) Do not ask any interactive question.
Deploys the 2.1.0 tag:
deploy 2.1.0
Deploys the master branch to another path:
deploy master /home/dev/inventory
Deploys non-interactively (updates the DB and restarts a worker):
deploy --update-db --restart-worker inventory-worker 2.1.0
Deploys non-interactively (doesn't update the DB and doesn't restart a worker):
deploy --no-update-db --no-restart-worker 2.1.0
Checkout the repository and install the dependencies with composer:
git clone [email protected]:myclabs/deploy.git
cd deploy
composer install
The script needs to be run as root, so change the permissions of the file to avoid errors running it as non-root:
sudo chown root bin/deploy
sudo chmod 0744 bin/deploy
The script can now be executed with:
sudo bin/deploy --help
To install globally on the machine (and be able to use deploy ...
), create a symlink:
sudo ln -s /path/to/project/bin/deploy /usr/local/bin/deploy