Capistrano tasks used to deploy Symfony based projects at Le Phare.
The default capistrano workflow is used with the addition of theses tasks.
after 'deploy:starting', 'composer:install_executable'
after 'deploy:publishing', 'symfony:assets:install'
after 'deploy:finishing', 'deploy:migrate'
after 'deploy:finished', 'deploy:cleanup'
Used to clear the APC cache at the end of the deployement. We recomend using it after after 'deploy:finishing'.
after 'deploy:finishing', 'apc:cache:clear'
The task will put a apc_clear_{revision}.php
file in the :webroot folder and call it via a local curl command.
The call is looped until it return the good revision.
Enable the apc monitor.
Disable the apc monitor.
Update the crontab with :crontab_file
. We recomend using it after after 'deploy:finishing'.
after 'deploy:finishing', 'crontab:update'
Backup the remote database in #{fetch(:deploy_to)}/backups
. We use mysqldump command with :mysqldump_args
.
The command only keep :keep_db_backups
backups.
Backup the remote database, download the backup in :db_pull_filename
and restore it locally.
Launch a deploy with assets uploading.
Publish assets declared in :assets_path
on remote server.
Launch symfony doctrine:migration:migrate
command.
Put a robots.txt that disallow robot indexing
Secure the application by putting a htpasswd authentification.
The credential are defined by :htpasswd_user
and :htpasswd_pwd
variables and you can whitelist IP with :htpasswd_whitelist
.
Push a librato annotation with :librato_username
and :librato_token
.
Look at defaults.rb to view defaults values.
to use a SSH gateway simply add :
set :ssh_gateway, "<user>@<host>"