Skip to content
This repository
Browse code

Add capistrano to project

  • Loading branch information...
commit a629fe0315684dae1e37037f7d7d4b7d5dbeb501 1 parent c900890
Jordan Byron authored
8  Capfile
... ...
@@ -0,0 +1,8 @@
  1
+load 'deploy' if respond_to?(:namespace) # cap2 differentiator
  2
+
  3
+# Uncomment if you are using Rails' asset pipeline
  4
+# load 'deploy/assets'
  5
+
  6
+Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
  7
+
  8
+load 'config/deploy' # remove this line to skip loading any of the default tasks
2  Gemfile
@@ -18,6 +18,8 @@ gem 'mailhopper', '~> 0.0.4'
18 18
 gem 'delayed_mailhopper'
19 19
 gem 'compass', '~> 0.11.5'
20 20
 
  21
+gem 'capistrano'
  22
+
21 23
 group :test do
22 24
   gem "minitest",  "~> 2.3.1"
23 25
   gem "capybara"
15  Gemfile.lock
@@ -36,6 +36,12 @@ GEM
36 36
     arel (2.2.1)
37 37
     bcrypt-ruby (3.0.1)
38 38
     builder (3.0.0)
  39
+    capistrano (2.9.0)
  40
+      highline
  41
+      net-scp (>= 1.0.0)
  42
+      net-sftp (>= 2.0.0)
  43
+      net-ssh (>= 2.0.14)
  44
+      net-ssh-gateway (>= 1.1.0)
39 45
     capybara (1.1.1)
40 46
       mime-types (>= 1.16)
41 47
       nokogiri (>= 1.3.3)
@@ -72,6 +78,7 @@ GEM
72 78
     ffi (1.0.9)
73 79
     fssm (0.2.7)
74 80
     haml (3.1.3)
  81
+    highline (1.6.2)
75 82
     hike (1.2.1)
76 83
     hominid (3.0.2)
77 84
     i18n (0.6.0)
@@ -91,6 +98,13 @@ GEM
91 98
     multi_xml (0.2.2)
92 99
     multipart-post (1.1.3)
93 100
     net-ldap (0.2.2)
  101
+    net-scp (1.0.4)
  102
+      net-ssh (>= 1.99.1)
  103
+    net-sftp (2.0.5)
  104
+      net-ssh (>= 2.0.9)
  105
+    net-ssh (2.2.1)
  106
+    net-ssh-gateway (1.1.0)
  107
+      net-ssh (>= 1.99.1)
94 108
     nokogiri (1.4.7)
95 109
     notifier (0.1.4)
96 110
     oa-basic (0.2.6)
@@ -198,6 +212,7 @@ PLATFORMS
198 212
 
199 213
 DEPENDENCIES
200 214
   albino
  215
+  capistrano
201 216
   capybara
202 217
   colorific (~> 1.0.0)
203 218
   compass (~> 0.11.5)
42  config/deploy.rb
... ...
@@ -0,0 +1,42 @@
  1
+require 'bundler/capistrano'
  2
+
  3
+set :application, "practicing-ruby-web"
  4
+set :repository,  "git://github.com/elm-city-craftworks/practicing-ruby-web.git"
  5
+
  6
+set :scm, :git
  7
+set :deploy_to, "/var/rapp/#{application}"
  8
+
  9
+set :user, "git"
  10
+set :use_sudo, false
  11
+
  12
+set :deploy_via, :remote_cache
  13
+
  14
+set :branch, "master"
  15
+server "practicingruby.com", :app, :web, :db, :primary => true
  16
+
  17
+namespace :deploy do
  18
+  task :restart, :roles => :app do
  19
+    run "touch #{current_path}/tmp/restart.txt"
  20
+  end
  21
+end
  22
+
  23
+after 'deploy:update_code' do
  24
+  { "database.yml"          => "config/database.yml",
  25
+    "mail_settings.rb"      => "config/initializers/mail_settings.rb",
  26
+    "mailchimp_settings.rb" => "config/initializers/mailchimp_settings.rb",
  27
+    "omniauth.rb"           => "config/initializers/omniauth.rb" }.
  28
+  each do |from, to|
  29
+    run "ln -nfs #{shared_path}/#{from} #{release_path}/#{to}"
  30
+  end
  31
+end
  32
+
  33
+before 'deploy' do
  34
+  puts "\n*** Capistrano not setup on server ***\n" +
  35
+       "***   Run webbynode push instead   ***\n\n"
  36
+  exit
  37
+end
  38
+
  39
+after "deploy", "deploy:migrate"
  40
+after "deploy", 'deploy:cleanup'
  41
+
  42
+# load 'deploy/assets' Asset Precompile

0 notes on commit a629fe0

Please sign in to comment.
Something went wrong with that request. Please try again.