Commit 92fee8ea496c9066fbdd5bb4c4244d2c2c749c2e
1 parent
6bb5483d
Exists in
master
and in
2 other branches
Capistrano config files
Showing
5 changed files
with
202 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +# Load DSL and Setup Up Stages | |
| 2 | +require 'capistrano/setup' | |
| 3 | + | |
| 4 | +# Includes default deployment tasks | |
| 5 | +require 'capistrano/deploy' | |
| 6 | + | |
| 7 | +# Includes tasks from other gems included in your Gemfile | |
| 8 | +# | |
| 9 | +# For documentation on these, see for example: | |
| 10 | +# | |
| 11 | +# https://github.com/capistrano/rvm | |
| 12 | +# https://github.com/capistrano/rbenv | |
| 13 | +# https://github.com/capistrano/chruby | |
| 14 | +# https://github.com/capistrano/bundler | |
| 15 | +# https://github.com/capistrano/rails | |
| 16 | +# | |
| 17 | +require 'capistrano/rvm' | |
| 18 | +# require 'capistrano/rbenv' | |
| 19 | +# require 'capistrano/chruby' | |
| 20 | +require 'capistrano/bundler' | |
| 21 | +require 'capistrano/rails/assets' | |
| 22 | +require 'capistrano/rails/migrations' | |
| 23 | + | |
| 24 | +# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. | |
| 25 | +Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +# Load DSL and Setup Up Stages | |
| 2 | +require 'capistrano/setup' | |
| 3 | + | |
| 4 | +# Includes default deployment tasks | |
| 5 | +require 'capistrano/deploy' | |
| 6 | + | |
| 7 | +# Includes tasks from other gems included in your Gemfile | |
| 8 | +# | |
| 9 | +# For documentation on these, see for example: | |
| 10 | +# | |
| 11 | +# https://github.com/capistrano/rvm | |
| 12 | +# https://github.com/capistrano/rbenv | |
| 13 | +# https://github.com/capistrano/chruby | |
| 14 | +# https://github.com/capistrano/bundler | |
| 15 | +# https://github.com/capistrano/rails | |
| 16 | +# | |
| 17 | +# require 'capistrano/rvm' | |
| 18 | +# require 'capistrano/rbenv' | |
| 19 | +# require 'capistrano/chruby' | |
| 20 | +# require 'capistrano/bundler' | |
| 21 | +# require 'capistrano/rails/assets' | |
| 22 | +# require 'capistrano/rails/migrations' | |
| 23 | + | |
| 24 | +# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. | |
| 25 | +Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } | ... | ... |
| ... | ... | @@ -0,0 +1,63 @@ |
| 1 | +# config valid only for Capistrano 3.1 | |
| 2 | +lock '3.2.1' | |
| 3 | + | |
| 4 | +set :application, 'vlibras-web2' | |
| 5 | +set :repo_url, 'git@bitbucket.org:fernandobrito/vlibras-web2.git' | |
| 6 | + | |
| 7 | +# Default branch is :master | |
| 8 | +# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call | |
| 9 | + | |
| 10 | +# Default deploy_to directory is /var/www/my_app | |
| 11 | +set :deploy_to, '/srv/vlibras-web2/' | |
| 12 | +set :deploy_via, :copy | |
| 13 | + | |
| 14 | +set :rails_env, 'production' | |
| 15 | + | |
| 16 | +set :use_sudo, false | |
| 17 | + | |
| 18 | +# Default value for :scm is :git | |
| 19 | +# set :scm, :git | |
| 20 | + | |
| 21 | +# Default value for :format is :pretty | |
| 22 | +# set :format, :pretty | |
| 23 | + | |
| 24 | +# Default value for :log_level is :debug | |
| 25 | +# set :log_level, :debug | |
| 26 | + | |
| 27 | +# Default value for :pty is false | |
| 28 | +# set :pty, true | |
| 29 | + | |
| 30 | +# Default value for :linked_files is [] | |
| 31 | +set :linked_files, %w{config/database.yml} | |
| 32 | + | |
| 33 | +# Default value for linked_dirs is [] | |
| 34 | +set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system} | |
| 35 | + | |
| 36 | +# Default value for default_env is {} | |
| 37 | +# set :default_env, { path: "/opt/ruby/bin:$PATH" } | |
| 38 | + | |
| 39 | +# Default value for keep_releases is 5 | |
| 40 | +set :keep_releases, 3 | |
| 41 | + | |
| 42 | +namespace :deploy do | |
| 43 | + | |
| 44 | + desc 'Restart application' | |
| 45 | + task :restart do | |
| 46 | + on roles(:app), in: :sequence, wait: 5 do | |
| 47 | + # Your restart mechanism here, for example: | |
| 48 | + # execute :touch, release_path.join('tmp/restart.txt') | |
| 49 | + end | |
| 50 | + end | |
| 51 | + | |
| 52 | + after :publishing, :restart | |
| 53 | + | |
| 54 | + after :restart, :clear_cache do | |
| 55 | + on roles(:web), in: :groups, limit: 3, wait: 10 do | |
| 56 | + # Here we can do anything such as: | |
| 57 | + # within release_path do | |
| 58 | + # execute :rake, 'cache:clear' | |
| 59 | + # end | |
| 60 | + end | |
| 61 | + end | |
| 62 | + | |
| 63 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,45 @@ |
| 1 | +# Simple Role Syntax | |
| 2 | +# ================== | |
| 3 | +# Supports bulk-adding hosts to roles, the primary server in each group | |
| 4 | +# is considered to be the first unless any hosts have the primary | |
| 5 | +# property set. Don't declare `role :all`, it's a meta role. | |
| 6 | + | |
| 7 | +role :app, %w{deploy@example.com} | |
| 8 | +role :web, %w{deploy@example.com} | |
| 9 | +role :db, %w{deploy@example.com} | |
| 10 | + | |
| 11 | + | |
| 12 | +# Extended Server Syntax | |
| 13 | +# ====================== | |
| 14 | +# This can be used to drop a more detailed server definition into the | |
| 15 | +# server list. The second argument is a, or duck-types, Hash and is | |
| 16 | +# used to set extended properties on the server. | |
| 17 | + | |
| 18 | +server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value | |
| 19 | + | |
| 20 | + | |
| 21 | +# Custom SSH Options | |
| 22 | +# ================== | |
| 23 | +# You may pass any option but keep in mind that net/ssh understands a | |
| 24 | +# limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start). | |
| 25 | +# | |
| 26 | +# Global options | |
| 27 | +# -------------- | |
| 28 | +# set :ssh_options, { | |
| 29 | +# keys: %w(/home/rlisowski/.ssh/id_rsa), | |
| 30 | +# forward_agent: false, | |
| 31 | +# auth_methods: %w(password) | |
| 32 | +# } | |
| 33 | +# | |
| 34 | +# And/or per server (overrides global) | |
| 35 | +# ------------------------------------ | |
| 36 | +# server 'example.com', | |
| 37 | +# user: 'user_name', | |
| 38 | +# roles: %w{web app}, | |
| 39 | +# ssh_options: { | |
| 40 | +# user: 'user_name', # overrides user setting above | |
| 41 | +# keys: %w(/home/user_name/.ssh/id_rsa), | |
| 42 | +# forward_agent: false, | |
| 43 | +# auth_methods: %w(publickey password) | |
| 44 | +# # password: 'please use keys' | |
| 45 | +# } | ... | ... |
| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | +# Simple Role Syntax | |
| 2 | +# ================== | |
| 3 | +# Supports bulk-adding hosts to roles, the primary server in each group | |
| 4 | +# is considered to be the first unless any hosts have the primary | |
| 5 | +# property set. Don't declare `role :all`, it's a meta role. | |
| 6 | + | |
| 7 | +# role :web, %w{deploy@example.com} | |
| 8 | + | |
| 9 | + | |
| 10 | +# Extended Server Syntax | |
| 11 | +# ====================== | |
| 12 | +# This can be used to drop a more detailed server definition into the | |
| 13 | +# server list. The second argument is a, or duck-types, Hash and is | |
| 14 | +# used to set extended properties on the server. | |
| 15 | + | |
| 16 | +server '150.165.204.30', port: 2220, user: 'deploy', roles: %w{web} | |
| 17 | + | |
| 18 | +set :rails_env, 'production' | |
| 19 | + | |
| 20 | +# Custom SSH Options | |
| 21 | +# ================== | |
| 22 | +# You may pass any option but keep in mind that net/ssh understands a | |
| 23 | +# limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start). | |
| 24 | +# | |
| 25 | +# Global options | |
| 26 | +# -------------- | |
| 27 | +# set :ssh_options, { | |
| 28 | +# keys: %w(/home/rlisowski/.ssh/id_rsa), | |
| 29 | +# forward_agent: false, | |
| 30 | +# auth_methods: %w(password) | |
| 31 | +# } | |
| 32 | +# | |
| 33 | +# And/or per server (overrides global) | |
| 34 | +# ------------------------------------ | |
| 35 | +# server 'example.com', | |
| 36 | +# user: 'user_name', | |
| 37 | +# roles: %w{web app}, | |
| 38 | +# ssh_options: { | |
| 39 | +# user: 'user_name', # overrides user setting above | |
| 40 | +# keys: %w(/home/user_name/.ssh/id_rsa), | |
| 41 | +# forward_agent: false, | |
| 42 | +# auth_methods: %w(publickey password) | |
| 43 | +# # password: 'please use keys' | |
| 44 | +# } | ... | ... |