Skip to content

Instantly share code, notes, and snippets.

@michiels
Last active August 29, 2015 14:17
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 michiels/5488d8d88be7428483ea to your computer and use it in GitHub Desktop.
Save michiels/5488d8d88be7428483ea to your computer and use it in GitHub Desktop.
intercity CLI deploy.rb
set :application, 'APPNAME'
set :repo_url, 'git@github.com:YOU/APPNAME.git'
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/u/apps/APPNAME'
# Use agent forwarding for SSH so you can deploy with the SSH key on your workstation.
set :ssh_options, {
forward_agent: true
}
# Default value for :pty is false
set :pty, true
# Default value for :linked_files is []
set :linked_files, %w{config/database.yml}
# Default value for linked_dirs is []
set :linked_dirs, %w{.rbenv-vars bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# Default value for default_env is {}
set :default_env, { path: "/opt/rbenv/shims:$PATH" }
set :bundle_bins, fetch(:bundle_bins, []).push("unicorn")
# Default value for keep_releases is 5
# set :keep_releases, 5
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
execute :touch, release_path.join('tmp/restart.txt')
end
end
after :publishing, :restart
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment