crossroads_capistrano 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -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.
|
6
|
+
s.version = "1.2.0"
|
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"]
|
@@ -18,3 +18,4 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
end
|
21
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
desc "Show currently deployed revision on server."
|
2
|
+
task :revisions, :roles => :app do
|
3
|
+
current, previous, latest = current_revision[0,7], previous_revision[0,7], real_revision[0,7]
|
4
|
+
puts "\n" << "-"*63
|
5
|
+
puts "===== Master Revision: \033[1;33m#{latest}\033[0m\n\n"
|
6
|
+
puts "===== [ \033[1;36m#{application.capitalize} - #{stage.capitalize}\033[0m ]"
|
7
|
+
puts "=== Deployed Revision: \033[1;32m#{current}\033[0m"
|
8
|
+
puts "=== Previous Revision: \033[1;32m#{previous}\033[0m\n\n"
|
9
|
+
# Show difference between master and deployed revisions.
|
10
|
+
if (diff = `git log #{current}..#{latest} --oneline`) != ""
|
11
|
+
diff.gsub!(/^([a-f0-9]+) /, "\033[1;32m" << '\1' << "\033[0m - ")
|
12
|
+
diff = " " << diff.gsub("\n", "\n ") << "\n"
|
13
|
+
puts "=== Difference between master revision and deployed revision:\n\n"
|
14
|
+
puts diff
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -1,17 +1,21 @@
|
|
1
1
|
module CrossroadsCapistrano
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
if defined?(Capistrano)
|
3
|
+
@@cap_config = Capistrano::Configuration.instance(:must_exist)
|
4
|
+
class << self
|
5
|
+
def load_recipes(recipes)
|
6
|
+
@@cap_config.load do
|
7
|
+
if recipes == :all
|
8
|
+
# Load all available recipes.
|
9
|
+
Dir.glob(File.join(File.dirname(__FILE__), 'crossroads_capistrano', '*.rb')).each{|f| load f}
|
10
|
+
else
|
11
|
+
# Load each specified recipe.
|
12
|
+
recipes.each {|r| load File.join(File.dirname(__FILE__),'crossroads_capistrano',"#{r}.rb")}
|
13
|
+
end
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
17
|
+
else
|
18
|
+
puts "Capistrano gem is not loaded."
|
15
19
|
end
|
16
20
|
end
|
17
21
|
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 1
|
7
|
-
-
|
7
|
+
- 2
|
8
8
|
- 0
|
9
|
-
version: 1.
|
9
|
+
version: 1.2.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Steve Kenworthy
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-02-26 00:00:00 +08:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- lib/crossroads_capistrano/passenger.rb
|
43
43
|
- lib/crossroads_capistrano/postgresql.rb
|
44
44
|
- lib/crossroads_capistrano/prompt.rb
|
45
|
+
- lib/crossroads_capistrano/revisions.rb
|
45
46
|
- lib/crossroads_capistrano/rvm.rb
|
46
47
|
- lib/crossroads_capistrano/stack.rb
|
47
48
|
- lib/crossroads_capistrano/whenever.rb
|