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
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
# Simple Role Syntax
|
||||
# ==================
|
||||
# Supports bulk-adding hosts to roles, the primary server in each group
|
||||
# is considered to be the first unless any hosts have the primary
|
||||
# property set. Don't declare `role :all`, it's a meta role.
|
||||
|
||||
role :app, %w{deploy@qwaiter.com}
|
||||
role :web, %w{deploy@qwaiter.com}
|
||||
role :db, %w{deploy@qwaiter.com}
|
||||
|
||||
|
||||
# Extended Server Syntax
|
||||
# ======================
|
||||
# This can be used to drop a more detailed server definition into the
|
||||
# server list. The second argument is a, or duck-types, Hash and is
|
||||
# used to set extended properties on the server.
|
||||
|
||||
server 'qwaiter.com', user: 'root', roles: %w{web app}, my_property: :my_value
|
||||
|
||||
|
||||
# Custom SSH Options
|
||||
# ==================
|
||||
# You may pass any option but keep in mind that net/ssh understands a
|
||||
# limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start).
|
||||
#
|
||||
# Global options
|
||||
# --------------
|
||||
# set :ssh_options, {
|
||||
# keys: %w(/home/rlisowski/.ssh/id_rsa),
|
||||
# forward_agent: false,
|
||||
# auth_methods: %w(password)
|
||||
# }
|
||||
#
|
||||
# And/or per server (overrides global)
|
||||
# ------------------------------------
|
||||
# server 'qwaiter.com',
|
||||
# user: 'user_name',
|
||||
# roles: %w{web app},
|
||||
# ssh_options: {
|
||||
# user: 'user_name', # overrides user setting above
|
||||
# keys: %w(/home/user_name/.ssh/id_rsa),
|
||||
# forward_agent: false,
|
||||
# auth_methods: %w(publickey password)
|
||||
# # password: 'please use keys'
|
||||
# }
|
||||
@@ -0,0 +1,45 @@
|
||||
# Simple Role Syntax
|
||||
# ==================
|
||||
# Supports bulk-adding hosts to roles, the primary server in each group
|
||||
# is considered to be the first unless any hosts have the primary
|
||||
# property set. Don't declare `role :all`, it's a meta role.
|
||||
|
||||
role :app, %w{deploy@example.com}
|
||||
role :web, %w{deploy@example.com}
|
||||
role :db, %w{deploy@example.com}
|
||||
|
||||
|
||||
# Extended Server Syntax
|
||||
# ======================
|
||||
# This can be used to drop a more detailed server definition into the
|
||||
# server list. The second argument is a, or duck-types, Hash and is
|
||||
# used to set extended properties on the server.
|
||||
|
||||
server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value
|
||||
|
||||
|
||||
# Custom SSH Options
|
||||
# ==================
|
||||
# You may pass any option but keep in mind that net/ssh understands a
|
||||
# limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start).
|
||||
#
|
||||
# Global options
|
||||
# --------------
|
||||
# set :ssh_options, {
|
||||
# keys: %w(/home/rlisowski/.ssh/id_rsa),
|
||||
# forward_agent: false,
|
||||
# auth_methods: %w(password)
|
||||
# }
|
||||
#
|
||||
# And/or per server (overrides global)
|
||||
# ------------------------------------
|
||||
# server 'example.com',
|
||||
# user: 'user_name',
|
||||
# roles: %w{web app},
|
||||
# ssh_options: {
|
||||
# user: 'user_name', # overrides user setting above
|
||||
# keys: %w(/home/user_name/.ssh/id_rsa),
|
||||
# forward_agent: false,
|
||||
# auth_methods: %w(publickey password)
|
||||
# # password: 'please use keys'
|
||||
# }
|
||||
Reference in New Issue
Block a user