crossroads_capistrano 1.1.0 → 1.2.0

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.1.0"
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
+
@@ -19,6 +19,7 @@ namespace :stack do
19
19
  task :default do
20
20
  yum.update
21
21
  yum.install( {:base => packages_for_project}, :stable ) if packages_for_project
22
+
22
23
  gems
23
24
 
24
25
  deploy.setup
@@ -1,17 +1,21 @@
1
1
  module CrossroadsCapistrano
2
- @@cap_config = Capistrano::Configuration.instance(:must_exist)
3
- class << self
4
- def load_recipes(recipes)
5
- @@cap_config.load do
6
- if recipes == :all
7
- # Load all available recipes.
8
- Dir.glob(File.join(File.dirname(__FILE__), 'crossroads_capistrano', '*.rb')).each{|f| load f}
9
- else
10
- # Load each specified recipe.
11
- recipes.each {|r| load File.join(File.dirname(__FILE__),'crossroads_capistrano',"#{r}.rb")}
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
- - 1
7
+ - 2
8
8
  - 0
9
- version: 1.1.0
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-01-22 00:00:00 +08:00
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