diff options
| author | mo khan <mo@mokhan.ca> | 2014-08-22 21:18:50 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-08-22 21:18:50 -0600 |
| commit | 862f2cb16a498bd284d0ab8feea320adef7b0c2e (patch) | |
| tree | f59ed9ca1ea827a789a8a77c70cbed07ed1de163 | |
| parent | dc568f8d66f579384778188417b356443c430c44 (diff) | |
move old cap to old_cap folder.
| -rw-r--r-- | Capfile | 28 | ||||
| -rw-r--r-- | Gemfile | 8 | ||||
| -rw-r--r-- | Gemfile.lock | 37 | ||||
| -rw-r--r-- | config/deploy.rb | 96 | ||||
| -rw-r--r-- | old_cap/Capfile | 3 | ||||
| -rw-r--r-- | old_cap/deploy.rb | 38 | ||||
| -rw-r--r-- | old_cap/recipes/base.rb (renamed from config/recipes/base.rb) | 0 | ||||
| -rw-r--r-- | old_cap/recipes/delayed_job.rb (renamed from config/recipes/delayed_job.rb) | 0 | ||||
| -rw-r--r-- | old_cap/recipes/environments.rb (renamed from config/recipes/environments.rb) | 0 | ||||
| -rw-r--r-- | old_cap/recipes/monit.rb (renamed from config/recipes/monit.rb) | 0 | ||||
| -rw-r--r-- | old_cap/recipes/nginx.rb (renamed from config/recipes/nginx.rb) | 0 | ||||
| -rw-r--r-- | old_cap/recipes/postgresql.rb (renamed from config/recipes/postgresql.rb) | 0 | ||||
| -rw-r--r-- | old_cap/recipes/templates/500.sh.erb (renamed from config/recipes/templates/500.sh.erb) | 0 | ||||
| -rw-r--r-- | old_cap/recipes/unicorn.rb (renamed from config/recipes/unicorn.rb) | 0 | ||||
| -rw-r--r-- | old_cap/tasks/rails.rb (renamed from config/tasks/rails.rb) | 0 | ||||
| -rw-r--r-- | old_cap/tasks/utility.rb (renamed from config/tasks/utility.rb) | 0 |
16 files changed, 152 insertions, 58 deletions
@@ -1,3 +1,25 @@ -load 'deploy' -load 'deploy/assets' -load 'config/deploy' # remove this line to skip loading any of the default tasks +# Load DSL and Setup Up Stages +require 'capistrano/setup' + +# Includes default deployment tasks +require 'capistrano/deploy' + +# Includes tasks from other gems included in your Gemfile +# +# For documentation on these, see for example: +# +# https://github.com/capistrano/rvm +# https://github.com/capistrano/rbenv +# https://github.com/capistrano/chruby +# https://github.com/capistrano/bundler +# https://github.com/capistrano/rails +# +# require 'capistrano/rvm' +# require 'capistrano/rbenv' +# require 'capistrano/chruby' +# require 'capistrano/bundler' +# require 'capistrano/rails/assets' +# require 'capistrano/rails/migrations' + +# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. +Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } @@ -38,8 +38,12 @@ gem 'ejs', '~> 1.1.1' gem 'js-routes', '~> 0.9.8' group :development do - gem 'capistrano', '~> 2.15.5' - gem 'capistrano-ext', '~> 1.2.1' + #gem 'capistrano', '~> 2.15.5' + #gem 'capistrano-ext', '~> 1.2.1' + gem 'capistrano', '~> 3.0', require: false + gem 'capistrano-rails', '~> 1.1', require: false + gem 'capistrano-bundler', '~> 1.1', require: false + gem 'capistrano-rbenv', '~> 2.0', require: false gem 'bullet' gem 'better_errors' gem 'lol_dba' diff --git a/Gemfile.lock b/Gemfile.lock index 1f1ce813..20f83338 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -52,14 +52,19 @@ GEM bullet (4.13.1) activesupport (>= 3.0.0) uniform_notifier (>= 1.6.0) - capistrano (2.15.5) - highline - net-scp (>= 1.0.0) - net-sftp (>= 2.0.0) - net-ssh (>= 2.0.14) - net-ssh-gateway (>= 1.1.0) - capistrano-ext (1.2.1) - capistrano (>= 1.0.0) + capistrano (3.2.1) + i18n + rake (>= 10.0.0) + sshkit (~> 1.3) + capistrano-bundler (1.1.3) + capistrano (~> 3.1) + sshkit (~> 1.2) + capistrano-rails (1.1.1) + capistrano (~> 3.1) + capistrano-bundler (~> 1.1) + capistrano-rbenv (2.0.2) + capistrano (~> 3.1) + sshkit (~> 1.3) capybara (2.4.1) mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -81,6 +86,7 @@ GEM coffee-script-source execjs coffee-script-source (1.7.0) + colorize (0.7.3) daemons (1.1.9) dalli (2.7.2) database_cleaner (1.3.0) @@ -146,7 +152,6 @@ GEM gibbon (1.1.3) httparty multi_json (>= 1.3.4) - highline (1.6.21) hike (1.2.3) http (0.6.1) http_parser.rb (~> 0.6.0) @@ -193,11 +198,7 @@ GEM naught (1.0.0) net-scp (1.2.1) net-ssh (>= 2.6.5) - net-sftp (2.1.2) - net-ssh (>= 2.6.5) net-ssh (2.9.1) - net-ssh-gateway (1.2.0) - net-ssh (>= 2.6.5) newrelic_rpm (3.9.0.229) nokogiri (1.6.2.1) mini_portile (= 0.6.0) @@ -281,6 +282,10 @@ GEM activesupport (>= 3.0) sprockets (~> 2.8) sqlite3 (1.3.9) + sshkit (1.5.1) + colorize + net-scp (>= 1.1.2) + net-ssh (>= 2.8.0) subexec (0.2.3) teaspoon (0.8.0) railties (>= 3.2.5, < 5) @@ -332,8 +337,10 @@ DEPENDENCIES binding_of_caller bootstrap-sass (~> 2.3.0) bullet - capistrano (~> 2.15.5) - capistrano-ext (~> 1.2.1) + capistrano (~> 3.0) + capistrano-bundler (~> 1.1) + capistrano-rails (~> 1.1) + capistrano-rbenv (~> 2.0) capybara carrierwave (~> 0.9.0) coffee-rails (~> 4.0.0) diff --git a/config/deploy.rb b/config/deploy.rb index 679e2c36..b12c1346 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,38 +1,58 @@ -require 'bundler/capistrano' -require 'dotenv/deployment/capistrano' - -load "config/recipes/environments" -load "config/recipes/base" -load "config/recipes/nginx" -load "config/recipes/unicorn" -load "config/recipes/postgresql" -load "config/recipes/delayed_job" -load "config/recipes/monit" -load "config/tasks/utility" -load "config/tasks/rails" - -set :application, "cakeside" -set :user, "deployer" -set :use_sudo, false -default_run_options[:pty] = true # password prompt - -# git -set :scm, :git -set :scm_verbose, true -set :repository, "git@bitbucket.org:cakeside/cakeside.git" -set :branch, "master" -set :deploy_via, :remote_cache - -#copy -#set :scm, :none -#set :repository, "." -#set :deploy_via, :copy - -set :deploy_to, "/home/#{user}/apps/#{application}" -set :keep_releases, 3 -set :normalize_asset_timestamps, false -set :ssh_options, {:forward_agent => true} - -after "deploy", "deploy:cleanup" # remove old releases - -require './config/boot' +# config valid only for Capistrano 3.1 +lock '3.2.1' + +set :application, 'cakeside' +set :repo_url, 'git@bitbucket.org:cakeside/cakeside.git' + +# Default branch is :master +# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call + +# Default deploy_to directory is /var/www/my_app +# set :deploy_to, '/var/www/my_app' + +# Default value for :scm is :git +# set :scm, :git + +# Default value for :format is :pretty +# set :format, :pretty + +# Default value for :log_level is :debug +# set :log_level, :debug + +# 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 + +namespace :deploy do + + 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 diff --git a/old_cap/Capfile b/old_cap/Capfile new file mode 100644 index 00000000..309bdbfd --- /dev/null +++ b/old_cap/Capfile @@ -0,0 +1,3 @@ +load 'deploy' +load 'deploy/assets' +load 'config/deploy' # remove this line to skip loading any of the default tasks diff --git a/old_cap/deploy.rb b/old_cap/deploy.rb new file mode 100644 index 00000000..679e2c36 --- /dev/null +++ b/old_cap/deploy.rb @@ -0,0 +1,38 @@ +require 'bundler/capistrano' +require 'dotenv/deployment/capistrano' + +load "config/recipes/environments" +load "config/recipes/base" +load "config/recipes/nginx" +load "config/recipes/unicorn" +load "config/recipes/postgresql" +load "config/recipes/delayed_job" +load "config/recipes/monit" +load "config/tasks/utility" +load "config/tasks/rails" + +set :application, "cakeside" +set :user, "deployer" +set :use_sudo, false +default_run_options[:pty] = true # password prompt + +# git +set :scm, :git +set :scm_verbose, true +set :repository, "git@bitbucket.org:cakeside/cakeside.git" +set :branch, "master" +set :deploy_via, :remote_cache + +#copy +#set :scm, :none +#set :repository, "." +#set :deploy_via, :copy + +set :deploy_to, "/home/#{user}/apps/#{application}" +set :keep_releases, 3 +set :normalize_asset_timestamps, false +set :ssh_options, {:forward_agent => true} + +after "deploy", "deploy:cleanup" # remove old releases + +require './config/boot' diff --git a/config/recipes/base.rb b/old_cap/recipes/base.rb index 4c520a65..4c520a65 100644 --- a/config/recipes/base.rb +++ b/old_cap/recipes/base.rb diff --git a/config/recipes/delayed_job.rb b/old_cap/recipes/delayed_job.rb index ff56b4a7..ff56b4a7 100644 --- a/config/recipes/delayed_job.rb +++ b/old_cap/recipes/delayed_job.rb diff --git a/config/recipes/environments.rb b/old_cap/recipes/environments.rb index b9e5e773..b9e5e773 100644 --- a/config/recipes/environments.rb +++ b/old_cap/recipes/environments.rb diff --git a/config/recipes/monit.rb b/old_cap/recipes/monit.rb index 1ba9ad05..1ba9ad05 100644 --- a/config/recipes/monit.rb +++ b/old_cap/recipes/monit.rb diff --git a/config/recipes/nginx.rb b/old_cap/recipes/nginx.rb index 256f99b5..256f99b5 100644 --- a/config/recipes/nginx.rb +++ b/old_cap/recipes/nginx.rb diff --git a/config/recipes/postgresql.rb b/old_cap/recipes/postgresql.rb index 15ec5cea..15ec5cea 100644 --- a/config/recipes/postgresql.rb +++ b/old_cap/recipes/postgresql.rb diff --git a/config/recipes/templates/500.sh.erb b/old_cap/recipes/templates/500.sh.erb index 7ec8f66d..7ec8f66d 100644 --- a/config/recipes/templates/500.sh.erb +++ b/old_cap/recipes/templates/500.sh.erb diff --git a/config/recipes/unicorn.rb b/old_cap/recipes/unicorn.rb index 6266694c..6266694c 100644 --- a/config/recipes/unicorn.rb +++ b/old_cap/recipes/unicorn.rb diff --git a/config/tasks/rails.rb b/old_cap/tasks/rails.rb index 4fccdeab..4fccdeab 100644 --- a/config/tasks/rails.rb +++ b/old_cap/tasks/rails.rb diff --git a/config/tasks/utility.rb b/old_cap/tasks/utility.rb index e4d652df..e4d652df 100644 --- a/config/tasks/utility.rb +++ b/old_cap/tasks/utility.rb |
