crossroads_capistrano 1.4.5 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
- data/crossroads_capistrano.gemspec +1 -1
- data/lib/crossroads_capistrano/recipes/base.rb +3 -0
- data/lib/crossroads_capistrano/recipes/hoptoad.rb +2 -3
- data/lib/crossroads_capistrano/recipes/ldap.rb +0 -2
- data/lib/crossroads_capistrano/recipes/newrelic.rb +16 -8
- data/lib/crossroads_capistrano/recipes/passenger.rb +5 -9
- data/lib/crossroads_capistrano/recipes/revisions.rb +1 -1
- data/lib/crossroads_capistrano/recipes/rvm.rb +2 -2
- metadata +2 -2
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "crossroads_capistrano"
|
6
|
-
s.version = "1.4.
|
6
|
+
s.version = "1.4.6"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Steve Kenworthy", "Ben Tillman", "Nathan Broadbent"]
|
9
9
|
s.email = ["it_dept@crossroads.org.hk"]
|
@@ -36,6 +36,9 @@ def needs_ssh_key?; repository.include?("github.com"); end
|
|
36
36
|
before "deploy:symlink", "deploy:symlink_config"
|
37
37
|
after "deploy:restart", "deploy:cleanup"
|
38
38
|
|
39
|
+
# Deployment tasks that need an after hook to notify hoptoad/newrelic/etc.
|
40
|
+
NotificationTasks = ["deploy", "deploy:migrations", "deploy:cold", "deploy:rollback"]
|
41
|
+
|
39
42
|
|
40
43
|
# Misc. Tasks
|
41
44
|
# ---------------------------------------------------------
|
@@ -5,7 +5,7 @@ namespace :deploy do
|
|
5
5
|
desc "Notify Hoptoad of the deployment"
|
6
6
|
task :notify_hoptoad, :except => { :no_release => true } do
|
7
7
|
if ARGV.include?("-n")
|
8
|
-
puts "\n ** Dry run, not notifying
|
8
|
+
puts "\n ** Dry run, not notifying Hoptoad.\n\n"
|
9
9
|
else
|
10
10
|
begin
|
11
11
|
require 'active_support/core_ext/string'
|
@@ -36,6 +36,5 @@ namespace :deploy do
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
after
|
40
|
-
after "deploy:migrations", "deploy:notify_hoptoad"
|
39
|
+
after NotificationTasks, "deploy:notify_hoptoad"
|
41
40
|
|
@@ -1,13 +1,21 @@
|
|
1
|
-
|
2
|
-
task :default do
|
3
|
-
newrelic.yml
|
4
|
-
end
|
1
|
+
require 'new_relic/recipes'
|
5
2
|
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
namespace :deploy do
|
4
|
+
desc "Notify New Relic of the deployment"
|
5
|
+
task :notify_newrelic, :except => { :no_release => true } do
|
6
|
+
if stage.to_s == 'live'
|
7
|
+
if File.exists?('config/newrelic.yml')
|
8
|
+
if ARGV.include?("-n")
|
9
|
+
puts "\n ** Dry run, not notifying New Relic.\n\n"
|
10
|
+
else
|
11
|
+
newrelic.notice_deployment
|
12
|
+
end
|
13
|
+
else
|
14
|
+
puts "\n !! You need to set up 'config/newrelic.yml'.\n You can copy the shared/config files from a server by running 'cap config:pull'.\n\n"
|
15
|
+
end
|
16
|
+
end
|
9
17
|
end
|
10
18
|
end
|
11
19
|
|
12
|
-
|
20
|
+
after NotificationTasks, "deploy:notify_newrelic"
|
13
21
|
|
@@ -34,8 +34,8 @@ namespace :passenger do
|
|
34
34
|
desc "Install Passenger"
|
35
35
|
task :install, :roles => :web do
|
36
36
|
install_deps
|
37
|
-
|
38
|
-
|
37
|
+
passenger_install_cmd = (exists?(:rvm_ruby_string) ? "rvmsudo " : "") << "passenger-install-apache2-module --auto" # sets up ruby wrapper correctly
|
38
|
+
run "if ! (gem list | grep passenger | grep #{passenger_version}); then gem install passenger --no-rdoc --no-ri --version #{passenger_version} && #{passenger_install_cmd}; fi"
|
39
39
|
end
|
40
40
|
|
41
41
|
task :install_deps, :roles => :web do
|
@@ -43,15 +43,11 @@ namespace :passenger do
|
|
43
43
|
sudo "rm -rf /etc/httpd/conf.d/ssl.conf"
|
44
44
|
end
|
45
45
|
|
46
|
-
desc "
|
46
|
+
desc "Set up Apache and Passenger config files"
|
47
47
|
task :config, :roles => :web do
|
48
48
|
# You can set the following paths from your deploy.rb file, if needed.
|
49
|
-
unless
|
50
|
-
|
51
|
-
end
|
52
|
-
unless respond_to?(:passenger_conf_path)
|
53
|
-
passenger_conf_path = "/etc/httpd/mods-enabled/passenger.conf"
|
54
|
-
end
|
49
|
+
set :httpd_site_conf_path, "/etc/httpd/sites-enabled/010-#{application}-#{stage}.conf" unless exists?(:httpd_site_conf_path)
|
50
|
+
set :passenger_conf_path, "/etc/httpd/mods-enabled/passenger.conf" unless exists?(:passenger_conf_path)
|
55
51
|
|
56
52
|
if respond_to?(:rvm_ruby_string) # Deploying with RVM
|
57
53
|
ruby_root = "/usr/local/rvm/wrappers/#{rvm_ruby_string}/ruby"
|
@@ -5,8 +5,8 @@ namespace :rvm do
|
|
5
5
|
desc "Install rvm"
|
6
6
|
task :install, :roles => :web do
|
7
7
|
install_deps
|
8
|
-
|
9
|
-
|
8
|
+
run "if ! [ -e #{rvm_bin_path}/rvm ]; then #{sudo} bash -c \"curl -s https://rvm.beginrescueend.com/install/rvm | bash\"; fi", :shell => 'sh'
|
9
|
+
run "if ! (#{rvm_bin_path}/rvm list | grep #{rvm_ruby_string}); then #{sudo} #{rvm_bin_path}/rvm install #{rvm_ruby_string}; fi", :shell => 'sh'
|
10
10
|
end
|
11
11
|
|
12
12
|
task :install_deps, :roles => :web do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crossroads_capistrano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2011-05-
|
14
|
+
date: 2011-05-26 00:00:00.000000000 +08:00
|
15
15
|
default_executable:
|
16
16
|
dependencies: []
|
17
17
|
description: A Crossroads Foundation collection of generic capistrano recipes.
|