New variables for shell and SFTP deployments
Many deployment scenarios trigger commands on servers for things like building assets, restarting services or pulling the updated changes. Sometimes it's useful to have information about the deployment added dynamically to the scenario. For example, the following script:
cd %REMOTE_PATH%
rake record-deployment %COMMIT% %USER_NAME%
During deployment will turn into:
cd /var/www/myapp
rake record-deployment eff0da5e dima@wildbit.com
Today we are extending the list of available variables to make your deployment scripts more powerful and convenient. See the updated list below, new variables are marked with *.
%COMMIT% or %REVISION% – Commit that is being deployed.
%BRANCH% – Branch that is being deployed, Git only.
%COMMENT% – Deployment comment.
%USER_NAME% – Name of the user who triggered the deployment.
%RELEASE_ID% – *Unique ID for the triggered deployment. Stays same during retries.
%TIMESTAMP_UTC% – *Time when deployment was triggered in UNIX epoch format.
%REMOTE_PATH% – *Remote path from settings of this particular deployment server.
%WORKING_DIR% – *Working Directory from settings of this particular deployment server.
%REPO_NAME% – *Name of the repository.
%ENV_NAME% – *Name of the current environment.
%ROLLBACK?% – *Either 1 or 0 if deployment is a rollback or not.
%FROM_SCRATCH?% – Either 1 or 0 if deployment is from scratch or not.
%AUTO?% – *Either 1 or 0 if deployment was triggered automatically or manually.
Let us know if we're missing anything else that could be useful for your deployment scenario.
Enjoy!
Update: Added a few new variables to the list.
Update 2: %REVISION% is now deprecated in favor of %COMMIT%.