Skip to content

Instantly share code, notes, and snippets.

@sadikay
Last active October 10, 2018 16:49
Show Gist options
  • Save sadikay/4fbe18789212536aaa134d0c5c3087de to your computer and use it in GitHub Desktop.
Save sadikay/4fbe18789212536aaa134d0c5c3087de to your computer and use it in GitHub Desktop.
server 'staging-ip', user: 'staging-user', roles: %w{app db}
set :branch, ENV['BRANCH']
set :application, 'application-name'
set :repo_url, "git@gitlab.com:your-repo-git-url.git"
set :deploy_to, "/home/ubuntu/apps/#{fetch(:application)}/#{fetch(:branch)}"
set :keep_releases, 1
set :copy_exclude, %w(.git/* tmp/*)
set :linked_dirs, %w{log tmp/pids tmp/cache vendor/bundle tmp/sockets}
set :rbenv_type, :user
set :rbenv_ruby, File.read('.ruby-version').to_s.strip
# make sure assets precompile even in app role
set :assets_roles, [:web, :app]
set :puma_env, 'production'
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
after :finished, 'deploy:cleanup'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment