Upgrade and add deploy options
This commit is contained in:
+47
-31
@@ -1,42 +1,58 @@
|
||||
#$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
|
||||
require "bundler/capistrano"
|
||||
#load 'deploy/assets'
|
||||
#
|
||||
load 'config/recipes/monit'
|
||||
# config valid only for Capistrano 3.1
|
||||
lock '3.2.1'
|
||||
|
||||
# Load RVM's capistrano plugin.
|
||||
#require "rvm/capistrano"
|
||||
set :application, 'qwaiter'
|
||||
set :repo_url, 'root@uflows.com:/var/git/qwaiter.git'
|
||||
|
||||
set :application, "qwaiter"
|
||||
set :repository, "root@uflows.com:/var/git/qwaiter.git"
|
||||
# Default branch is :master
|
||||
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
|
||||
|
||||
set :scm, :git
|
||||
#set :revision, '89700f36e9'
|
||||
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
|
||||
# Default deploy_to directory is /var/www/my_app
|
||||
# set :deploy_to, '/var/www/my_app'
|
||||
|
||||
# Do not touch public/images,stylesheets,javascripts
|
||||
set :normalize_asset_timestamps, false
|
||||
# Default value for :scm is :git
|
||||
# set :scm, :git
|
||||
|
||||
role :web, "qwaiter.com" # Your HTTP server, Apache/etc
|
||||
role :app, "qwaiter.com" # This may be the same as your `Web` server
|
||||
#role :db, "your primary db-server here", :primary => true # This is where Rails migrations will run
|
||||
#role :db, "your slave db-server here"
|
||||
# Default value for :format is :pretty
|
||||
# set :format, :pretty
|
||||
|
||||
# if you're still using the script/reaper helper you will need
|
||||
# these http://github.com/rails/irs_process_scripts
|
||||
# Default value for :log_level is :debug
|
||||
# set :log_level, :debug
|
||||
|
||||
set :deploy_via, :remote_cache
|
||||
set :branch, :master
|
||||
set :user, 'root'
|
||||
set :deploy_to, '/var/www/qwaiter'
|
||||
#set :bundle_cmd, 'bundle install --deployment'
|
||||
# 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{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
|
||||
|
||||
# Default value for default_env is {}
|
||||
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
|
||||
|
||||
# Default value for keep_releases is 5
|
||||
# set :keep_releases, 5
|
||||
|
||||
# If you are using Passenger mod_rails uncomment this:
|
||||
namespace :deploy do
|
||||
task :start do ; end
|
||||
task :stop do ; end
|
||||
task :restart, :roles => :app, :except => { :no_release => true } do
|
||||
run "#{try_sudo} chown -R www-data:www-data #{release_path}"
|
||||
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
|
||||
|
||||
desc 'Restart application'
|
||||
task :restart do
|
||||
on roles(:app), in: :sequence, wait: 5 do
|
||||
# Your restart mechanism here, for example:
|
||||
# execute :touch, release_path.join('tmp/restart.txt')
|
||||
end
|
||||
end
|
||||
|
||||
after :publishing, :restart
|
||||
|
||||
after :restart, :clear_cache do
|
||||
on roles(:web), in: :groups, limit: 3, wait: 10 do
|
||||
# Here we can do anything such as:
|
||||
# within release_path do
|
||||
# execute :rake, 'cache:clear'
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user