crossroads_capistrano 1.3.4 → 1.3.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -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.3.
|
|
6
|
+
s.version = "1.3.60"
|
|
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"]
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
namespace :deploy do
|
|
5
5
|
desc "Notify Hoptoad of the deployment"
|
|
6
6
|
task :notify_hoptoad, :except => { :no_release => true } do
|
|
7
|
-
|
|
7
|
+
begin
|
|
8
|
+
require 'active_support/core_ext/string'
|
|
9
|
+
rescue LoadError
|
|
10
|
+
end
|
|
8
11
|
require 'hoptoad_notifier'
|
|
9
12
|
require File.join(rails_root,'config','initializers','hoptoad')
|
|
10
13
|
require 'hoptoad_tasks'
|
|
@@ -26,17 +26,18 @@ namespace :passenger do
|
|
|
26
26
|
task :install, :roles => :web do
|
|
27
27
|
install_deps
|
|
28
28
|
run "if ! (gem list | grep passenger | grep #{passenger_version}); then gem install passenger --no-rdoc --no-ri --version #{passenger_version} && passenger-install-apache2-module --auto; fi"
|
|
29
|
-
|
|
29
|
+
sudo "rvm wrapper #{rvm_ruby_string} passenger" if defined?(:rvm_ruby_string) # sets up wrapper for passenger so it can find bundler etc...
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
task :install_deps, :roles => :web do
|
|
33
33
|
yum.install( {:base => %w(curl-devel httpd-devel apr-devel)}, :stable )
|
|
34
|
+
sudo "rm -rf /etc/httpd/conf.d/ssl.conf"
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
desc "Apache config files: uses special variables @DEPLOY_TO@ @IP_ADDR@ @SERVER_NAME@ @PASSENGER_ROOT@ @RUBY_ROOT@"
|
|
37
38
|
task :config, :roles => :web do
|
|
38
|
-
sudo "
|
|
39
|
-
|
|
39
|
+
sudo "cp -f #{release_path}/config/httpd-rails.conf /etc/httpd/sites-enabled/010-#{application}-#{stage}.conf"
|
|
40
|
+
sudo "sed -i -e 's%@DEPLOY_TO@%#{deploy_to}%g' -e 's%@IP_ADDR@%#{ip_address}%g' -e 's%@SERVER_NAME@%#{site_domain_name}%g' /etc/httpd/sites-enabled/010-#{application}-#{stage}.conf"
|
|
40
41
|
if respond_to?(:rvm_ruby_string) # Deploying with RVM
|
|
41
42
|
ruby_root = "/usr/local/rvm/wrappers/#{rvm_ruby_string}/ruby"
|
|
42
43
|
passenger_root = "/usr/local/rvm/gems/#{rvm_ruby_string}/gems/passenger-#{passenger_version}"
|
|
@@ -45,8 +46,8 @@ namespace :passenger do
|
|
|
45
46
|
passenger_root = capture("pass_path=`gem which phusion_passenger` && echo ${pass_path%/lib/phusion_passenger.rb}")
|
|
46
47
|
end
|
|
47
48
|
sed_args = "-e 's%@PASSENGER_ROOT@%#{passenger_root.strip}%g' -e 's%@RUBY_ROOT@%#{ruby_root.strip}%g'"
|
|
48
|
-
|
|
49
|
-
sudo "
|
|
49
|
+
sudo "cp -f #{release_path}/config/passenger.conf /etc/httpd/mods-enabled/passenger.conf"
|
|
50
|
+
sudo "sed -i #{sed_args} /etc/httpd/mods-enabled/passenger.conf"
|
|
50
51
|
end
|
|
51
52
|
end
|
|
52
53
|
|
|
@@ -2,6 +2,7 @@ namespace :deploy do
|
|
|
2
2
|
desc "Show currently deployed revision on server."
|
|
3
3
|
task :revisions, :roles => :app do
|
|
4
4
|
current, previous, latest = current_revision[0,7], previous_revision[0,7], real_revision[0,7]
|
|
5
|
+
# Following line 'right-aligns' the branch string.
|
|
5
6
|
branch_indent = " "*(i=10-branch.size;i<0 ? 0 : i) << branch.capitalize
|
|
6
7
|
current_is_deployed = current == latest
|
|
7
8
|
puts "\n * \033[0;32m== Showing revisions and diffs for [\033[1;32m#{application} #{stage}\033[0;32m]\033[0m\n\n"
|
|
@@ -18,9 +19,9 @@ namespace :deploy do
|
|
|
18
19
|
if (diff = `git log #{base_rev}..#{new_rev} --oneline`) != ""
|
|
19
20
|
# Colorize refs
|
|
20
21
|
diff.gsub!(/^([a-f0-9]+) /, "\033[1;37m\\1\033[0m: ")
|
|
21
|
-
diff = "
|
|
22
|
+
diff = " " << diff.gsub("\n", "\n ") << "\n"
|
|
22
23
|
# Indent commit messages nicely, max 80 chars per line, line has to end with space.
|
|
23
|
-
diff = diff.split("\n").map{|l|l.scan(/.{1,120}/).join("\n"<<" "*
|
|
24
|
+
diff = diff.split("\n").map{|l|l.scan(/.{1,120}/).join("\n"<<" "*18).gsub(/([^ ]*)\n {18}/m,"\n"<<" "*18<<"\\1")}.join("\n")
|
|
24
25
|
puts " * \033[0;32m== Difference between \033[1;32m#{base_label}\033[0;32m and \033[1;32m#{new_label}\033[0;32m:\033[0m\n\n"
|
|
25
26
|
puts diff
|
|
26
27
|
end
|
metadata
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: crossroads_capistrano
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
hash: 99
|
|
5
|
+
prerelease: false
|
|
6
|
+
segments:
|
|
7
|
+
- 1
|
|
8
|
+
- 3
|
|
9
|
+
- 60
|
|
10
|
+
version: 1.3.60
|
|
6
11
|
platform: ruby
|
|
7
12
|
authors:
|
|
8
13
|
- Steve Kenworthy
|
|
@@ -62,17 +67,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
62
67
|
requirements:
|
|
63
68
|
- - ">="
|
|
64
69
|
- !ruby/object:Gem::Version
|
|
70
|
+
hash: 3
|
|
71
|
+
segments:
|
|
72
|
+
- 0
|
|
65
73
|
version: "0"
|
|
66
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
75
|
none: false
|
|
68
76
|
requirements:
|
|
69
77
|
- - ">="
|
|
70
78
|
- !ruby/object:Gem::Version
|
|
79
|
+
hash: 3
|
|
80
|
+
segments:
|
|
81
|
+
- 0
|
|
71
82
|
version: "0"
|
|
72
83
|
requirements: []
|
|
73
84
|
|
|
74
85
|
rubyforge_project: crossroads_capistrano
|
|
75
|
-
rubygems_version: 1.
|
|
86
|
+
rubygems_version: 1.3.7
|
|
76
87
|
signing_key:
|
|
77
88
|
specification_version: 3
|
|
78
89
|
summary: Crossroads capistrano recipes
|