capistrano-conditional 0.0.2 → 0.0.3

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.
data/README.md CHANGED
@@ -83,7 +83,7 @@ I've got <code>cap deploy</code> in muscle memory, and I used to find myself for
83
83
  end
84
84
  end
85
85
 
86
- Since I use it on ever project, I've wrapped that logic up in a single command:
86
+ Since I use it on every project, I've wrapped that logic up in a single command:
87
87
 
88
88
  ConditionalDeploy.monitor_migrations(self)
89
89
 
@@ -5,12 +5,25 @@ Capistrano::Configuration.instance(:must_exist).load do
5
5
  namespace :conditional do
6
6
  desc "Initializes the conditional deployment functionality"
7
7
  task :apply do
8
- log = capture("cd #{current_path} && git log --format=oneline -n 1", :pty => false)
9
- ConditionalDeploy.apply_conditions!( log.split[0] )
8
+ deployed_hash = capture("cd #{current_path} && git log --format=oneline -n 1", :pty => false).split[0]
9
+ ConditionalDeploy.apply_conditions!( deployed_hash )
10
+ end
11
+
12
+ desc "Tests to be sure that the newest local and remote git commits match"
13
+ task :ensure_latest_git do
14
+ remote = capture("cd #{shared_path}/cached-copy && git log --format=oneline -n 1", :pty => false)
15
+ local = run_locally("git log --format=oneline -n 1")
16
+
17
+ unless local == remote
18
+ abort("\nLocal and remote git repositories have different HEADs:\n Local: #{local} Remote: #{remote}\n Make sure you've committed your latest changes, or else pull down the remote updates and try again\n")
19
+ end
10
20
  end
11
21
  end
12
22
 
13
23
  # Ensure deploys apply conditional elements before running the rest of the tasks
14
24
  before 'deploy', 'conditional:apply'
15
25
  before 'deploy:migrations', 'conditional:apply'
26
+
27
+ # Abort deployment if mismatch between local and remote git repositories
28
+ after 'deploy:update_code', 'conditional:ensure_latest_git'
16
29
  end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Conditional
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,60 +1,46 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: capistrano-conditional
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 2
10
- version: 0.0.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Kali Donovan
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-11-14 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-12-01 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: git
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70332715168240 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
32
22
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: capistrano
36
23
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70332715168240
25
+ - !ruby/object:Gem::Dependency
26
+ name: capistrano
27
+ requirement: &70332715294620 !ruby/object:Gem::Requirement
38
28
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
46
33
  type: :runtime
47
- version_requirements: *id002
48
- description: Allows making tasks for git-based projects conditional based on the specific files to be deployed.
49
- email:
34
+ prerelease: false
35
+ version_requirements: *70332715294620
36
+ description: Allows making tasks for git-based projects conditional based on the specific
37
+ files to be deployed.
38
+ email:
50
39
  - kali@deviantech.com
51
40
  executables: []
52
-
53
41
  extensions: []
54
-
55
42
  extra_rdoc_files: []
56
-
57
- files:
43
+ files:
58
44
  - .gitignore
59
45
  - Gemfile
60
46
  - README.md
@@ -65,38 +51,28 @@ files:
65
51
  - lib/capistrano-conditional/integration.rb
66
52
  - lib/capistrano-conditional/unit.rb
67
53
  - lib/capistrano-conditional/version.rb
68
- homepage: ""
54
+ homepage: ''
69
55
  licenses: []
70
-
71
56
  post_install_message:
72
57
  rdoc_options: []
73
-
74
- require_paths:
58
+ require_paths:
75
59
  - lib
76
- required_ruby_version: !ruby/object:Gem::Requirement
60
+ required_ruby_version: !ruby/object:Gem::Requirement
77
61
  none: false
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- hash: 3
82
- segments:
83
- - 0
84
- version: "0"
85
- required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
67
  none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- hash: 3
91
- segments:
92
- - 0
93
- version: "0"
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
94
72
  requirements: []
95
-
96
73
  rubyforge_project: capistrano-conditional
97
- rubygems_version: 1.8.11
74
+ rubygems_version: 1.8.10
98
75
  signing_key:
99
76
  specification_version: 3
100
77
  summary: Adds support for conditional deployment tasks in capistrano
101
78
  test_files: []
102
-