crossroads_capistrano 1.4.14 → 1.4.15

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.4.14"
6
+ s.version = "1.4.15"
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"]
@@ -1,11 +1,12 @@
1
1
  namespace :deploy do
2
2
  desc "Show currently deployed revision on server."
3
3
  task :revisions, :roles => :app do
4
+ stage_str = exists?(:stage) ? ' ' << stage.to_s : ''
4
5
  current, previous, latest = current_revision.to_s[0,7], previous_revision.to_s[0,7], real_revision.to_s[0,7]
5
6
  # Following line 'right-aligns' the branch string.
6
7
  branch_indent = " "*(i=10-branch.size;i<0 ? 0 : i) << branch.capitalize
7
8
  current_is_deployed = current == latest
8
- puts "\n * \033[0;32m== Showing revisions and diffs for [\033[1;32m#{application}#{exists?(:stage) ? ' ' << stage.to_s : ''}\033[0;32m]\033[0m\n\n"
9
+ puts "\n * \033[0;32m== Showing revisions and diffs for [\033[1;32m#{application}#{stage_str}\033[0;32m]\033[0m\n\n"
9
10
  puts " \033[1;33m#{branch_indent} Branch: \033[1;37m#{latest}\033[0m"
10
11
  puts " \033[#{current == latest ? 1 : 0};33mDeployed Revision: \033[#{current == latest ? 1 : 0};37m#{current}\033[0m"
11
12
  puts " \033[#{previous == latest ? 1 : 0};33mPrevious Revision: \033[#{previous == latest ? 1 : 0};37m#{previous}\033[0m\n\n"
@@ -16,14 +17,19 @@ namespace :deploy do
16
17
  ["previous revision", "deployed revision", previous, current]
17
18
 
18
19
  # Show difference between master and deployed revisions.
19
- if (diff = `git log #{base_rev}..#{new_rev} --oneline`) != ""
20
- # Colorize refs
21
- diff.gsub!(/^([a-f0-9]+) /, "\033[1;37m\\1\033[0m: ")
22
- diff = " " << diff.gsub("\n", "\n ") << "\n"
23
- # Indent commit messages nicely, max 80 chars per line, line has to end with space.
24
- diff = diff.split("\n").map{|l|l.scan(/.{1,120}/).join("\n"<<" "*19).gsub(/([^ ]*)\n {19}/m,"\n"<<" "*19<<"\\1")}.join("\n")
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"
26
- puts diff
20
+ if (diff = `git log #{base_rev}..#{new_rev} --oneline 2>&1`) != ""
21
+ if diff.include?("unknown revision or path not in the working tree")
22
+ puts " * You have deployed code that is not in your local repo.\n" +
23
+ " Please run 'git pull', then 'cap#{stage_str} deploy:revisions'"
24
+ else
25
+ # Colorize refs
26
+ diff.gsub!(/^([a-f0-9]+) /, "\033[1;37m\\1\033[0m: ")
27
+ diff = " " << diff.gsub("\n", "\n ") << "\n"
28
+ # Indent commit messages nicely, max 80 chars per line, line has to end with space.
29
+ diff = diff.split("\n").map{|l|l.scan(/.{1,120}/).join("\n"<<" "*19).gsub(/([^ ]*)\n {19}/m,"\n"<<" "*19<<"\\1")}.join("\n")
30
+ 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"
31
+ puts diff
32
+ end
27
33
  end
28
34
  end
29
35
  end
metadata CHANGED
@@ -1,36 +1,26 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: crossroads_capistrano
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 4
9
- - 14
10
- version: 1.4.14
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.4.15
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Steve Kenworthy
14
9
  - Ben Tillman
15
10
  - Nathan Broadbent
16
11
  autorequire:
17
12
  bindir: bin
18
13
  cert_chain: []
19
-
20
- date: 2011-05-27 00:00:00 +08:00
14
+ date: 2011-05-28 00:00:00.000000000 +08:00
21
15
  default_executable:
22
16
  dependencies: []
23
-
24
17
  description: A Crossroads Foundation collection of generic capistrano recipes.
25
- email:
18
+ email:
26
19
  - it_dept@crossroads.org.hk
27
20
  executables: []
28
-
29
21
  extensions: []
30
-
31
22
  extra_rdoc_files: []
32
-
33
- files:
23
+ files:
34
24
  - .gitignore
35
25
  - Gemfile
36
26
  - README.textile
@@ -60,36 +50,26 @@ files:
60
50
  has_rdoc: true
61
51
  homepage: http://www.crossroads.org.hk
62
52
  licenses: []
63
-
64
53
  post_install_message:
65
54
  rdoc_options: []
66
-
67
- require_paths:
55
+ require_paths:
68
56
  - lib
69
- required_ruby_version: !ruby/object:Gem::Requirement
57
+ required_ruby_version: !ruby/object:Gem::Requirement
70
58
  none: false
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- hash: 3
75
- segments:
76
- - 0
77
- version: "0"
78
- required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
64
  none: false
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- hash: 3
84
- segments:
85
- - 0
86
- version: "0"
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
87
69
  requirements: []
88
-
89
70
  rubyforge_project: crossroads_capistrano
90
- rubygems_version: 1.3.7
71
+ rubygems_version: 1.6.2
91
72
  signing_key:
92
73
  specification_version: 3
93
74
  summary: Crossroads capistrano recipes
94
75
  test_files: []
95
-