Commit 53b6726

mo khan <mo@mokhan.ca>
2017-02-18 21:49:01
switch to git based deployment.
1 parent 6c555ef
config/deploy.rb
@@ -1,44 +1,39 @@
 # config valid only for current version of Capistrano
-lock "3.4.1"
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
+lock "3.7.2"
 
 set :application, "stronglifters"
-set :deploy_to, "/var/www/stronglifters"
-set :scm, :s3
-set :bucket_name, "stronglifters"
-set :format, :pretty
-set :log_level, :warn
-set :keep_releases, 5
+set :repo_url, "git@gitlab.com:stronglifters/surface.git"
+
+# Default branch is :master
+# ask :branch, `git revparse abbrevref HEAD`.chomp
+
+# Default deploy_to directory is /var/www/my_app_name
+# set :deploy_to, "/var/www/my_app_name"
+
+# Default value for :format is :airbrussh.
+# set :format, :airbrussh
+
+# You can configure the Airbrussh format using :format_options.
+# These are the defaults.
+# set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto
 
 # Default value for :pty is false
 # set :pty, true
 
 # Default value for :linked_files is []
-set :linked_files, fetch(:linked_files, []).push(
-  "config/database.yml",
-  #".env.#{fetch(:rails_env, 'production')}",
-)
+append :linked_files, "config/database.yml"
 
 # Default value for linked_dirs is []
-set :linked_dirs, fetch(:linked_dirs, []).push(
-  "log",
-  "tmp/pids",
-  "tmp/cache",
-  "tmp/sockets",
-  "vendor/bundle",
-  "public/system",
-)
+append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system"
 
 # Default value for default_env is {}
 # set :default_env, { path: "/opt/ruby/bin:$PATH" }
 
-if File.exist?("config/deploy_id_rsa")
-  set :ssh_options, keys: ["config/deploy_id_rsa"], forward_agent: true
-else
-  set :ssh_options, forward_agent: true
-end
+# Default value for keep_releases is 5
+# set :keep_releases, 5
+set :ssh_options, forward_agent: true
 set :rbenv_type, :system
-set :rbenv_ruby, `cat .ruby-version`.strip
+set :rbenv_ruby, `cat .rubyversion`.strip
 
 namespace :deploy do
   task :restart do
@@ -51,12 +46,4 @@ namespace :deploy do
   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
Capfile
@@ -1,13 +1,38 @@
 # Load DSL and set up stages
-require 'capistrano/setup'
+require "capistrano/setup"
 
 # Include default deployment tasks
-require 'capistrano/deploy'
-require 'capistrano/rbenv'
-require 'capistrano/bundler'
-#require 'capistrano/rails'
-# require 'capistrano/rails/assets'
-require 'capistrano/rails/migrations'
+require "capistrano/deploy"
+
+# Load the SCM plugin appropriate to your project:
+#
+# require "capistrano/scm/hg"
+# install_plugin Capistrano::SCM::Hg
+# or
+# require "capistrano/scm/svn"
+# install_plugin Capistrano::SCM::Svn
+# or
+require "capistrano/scm/git"
+install_plugin Capistrano::SCM::Git
+
+# Include 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
+#   https://github.com/capistrano/passenger
+#
+# require "capistrano/rvm"
+require "capistrano/rbenv"
+# require "capistrano/chruby"
+require "capistrano/bundler"
+require "capistrano/rails/assets"
+require "capistrano/rails/migrations"
+# require "capistrano/passenger"
 
 # Load custom tasks from `lib/capistrano/tasks` if you have any defined
-Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
+Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
Gemfile
@@ -3,7 +3,7 @@ source "https://rubygems.org" do
   gem "brakeman", group: :development, require: false
   gem "bullet", group: [:development, :test]
   gem "byebug", group: [:development, :test], platform: :mri
-  gem "capistrano", "3.4.1"
+  gem "capistrano", "3.7.2"
   gem "capistrano-bundler", "~> 1.1", require: false, group: :development
   gem "capistrano-rails", group: :development
   gem "capistrano-rbenv", "~> 2.0", require: false, group: :development
Gemfile.lock
@@ -40,6 +40,8 @@ GEM
       minitest (~> 5.1)
       tzinfo (~> 1.1)
     addressable (2.4.0)
+    airbrussh (1.1.2)
+      sshkit (>= 1.6.1, != 1.7.0)
     arel (7.1.4)
     ast (2.3.0)
     axiom-types (0.1.1)
@@ -54,13 +56,16 @@ GEM
       uniform_notifier (~> 1.10.0)
     byebug (9.0.5)
     callsite (0.0.11)
-    capistrano (3.4.1)
+    capistrano (3.7.2)
+      airbrussh (>= 1.0.0)
+      capistrano-harrow
       i18n
       rake (>= 10.0.0)
-      sshkit (~> 1.3)
+      sshkit (>= 1.9.0)
     capistrano-bundler (1.1.4)
       capistrano (~> 3.1)
       sshkit (~> 1.2)
+    capistrano-harrow (0.5.3)
     capistrano-rails (1.1.7)
       capistrano (~> 3.1)
       capistrano-bundler (~> 1.1)
@@ -222,7 +227,7 @@ GEM
     multipart-post (2.0.0)
     net-scp (1.2.1)
       net-ssh (>= 2.6.5)
-    net-ssh (3.2.0)
+    net-ssh (4.1.0)
     nio4r (1.2.1)
     nokogiri (1.6.8.1)
       mini_portile2 (~> 2.1.0)
@@ -366,7 +371,7 @@ GEM
       actionpack (>= 4.0)
       activesupport (>= 4.0)
       sprockets (>= 3.0.0)
-    sshkit (1.11.1)
+    sshkit (1.12.0)
       net-scp (>= 1.1.2)
       net-ssh (>= 2.8.0)
     stackprof (0.2.9)
@@ -426,7 +431,7 @@ DEPENDENCIES
   brakeman!
   bullet!
   byebug!
-  capistrano (= 3.4.1)!
+  capistrano (= 3.7.2)!
   capistrano-bundler (~> 1.1)!
   capistrano-rails!
   capistrano-rbenv (~> 2.0)!
@@ -503,4 +508,4 @@ DEPENDENCIES
   yelp!
 
 BUNDLED WITH
-   1.13.7
+   1.14.4