# # Capistrano 3 deployment configuration # # http://www.capistranorb.com/ # https://semaphoreapp.com/blog/2013/11/26/capistrano-3-upgrade-guide.html # defaults that can be updated from the environment set :branch, ENV["REVISION"] || ENV["BRANCH_NAME"] || "master" # you probably want to change these set :application, 'foodsoft' # application name (whatever you like) set :domain, 'order.foodcoop.test' # host set :user, 'deploy' # ssh deploy user set :keep_releases, 10 set :repo_url, 'git://github.com/foodcoops/foodsoft.git' set :deploy_to, "/www/apps/#{fetch :application}-#{fetch :stage}" # more settings which are probably ok set :log_level, :info set :linked_files, %w{config/database.yml config/app_config.yml config/initializers/secret_token.rb} set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system} # assuming one server for everything, with one user for deploy and one for resque server fetch(:domain), user: fetch(:user), roles: [:web, :app, :resque, :db] # if you use RVM, uncomment the line in Capfile, and optionally uncomment rvm settings # set :rvm_ruby_string, :local # task hooks namespace :deploy do desc 'Restart application' task :restart do on roles(:app), in: :sequence, wait: 5 do # tell mod_passenger to reload the application execute :touch, release_path.join('tmp/restart.txt') end end after :restart, 'resque:restart' after :finishing, 'deploy:cleanup' # see lib/capistrano/tasks/plugins.cap #before 'bundler:install', 'enable_plugins:auto' end