Skip to content

Instantly share code, notes, and snippets.

@hemc4
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hemc4/4dc236f3f728d1e03648 to your computer and use it in GitHub Desktop.
Save hemc4/4dc236f3f728d1e03648 to your computer and use it in GitHub Desktop.
Capistrano 3 deployment script for Yii boilerplate
set :user, "ubuntu"
set :group, "www-data"
server "54.169.xx.xx",roles: %w{web app db}, :primary => true
server "54.179.xx.xx",roles: %w{web app db}
#server "54.169.xx.xx",roles: %w{web app db}
#server "54.169.xx.xx",roles: %w{web app db}
#server "54.169.xx.xx",roles: %w{web app db}
set :use_sudo, true
set :pty, true
set :ssh_options, {
user: 'ubuntu',
forward_agent: true,
auth_methods: ["publickey"],
keys: ["/path_to_key/key_name.pem"]
}
desc "create and reset runtime files"
task :reset_assets do
on roles(:all) do
execute :php, "/var/www/html/{project_dir}/current/common/lib/postdeploy.php "
end
end
after "deploy:published" , "reset_assets"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment