whiskey_disk 0.6.21 → 0.6.22

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/CHANGELOG CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ 0.6.22 / 2011-04-10
3
+ ==================
4
+
5
+ * support branch-switching on deployments
6
+ * added integration spec for "branch switching" behavior
7
+
2
8
  0.6.21 / 2011-04-06
3
9
  ==================
4
10
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.21
1
+ 0.6.22
data/lib/whiskey_disk.rb CHANGED
@@ -91,12 +91,12 @@ class WhiskeyDisk
91
91
  needs(:deploy_to, :repository)
92
92
 
93
93
  check = "cd #{self[:deploy_to]}; " +
94
- "ml=\`cat .git/refs/heads/#{branch}\`; " +
94
+ "ml=\`git log -1 --pretty=format:%H\`; " +
95
95
  "mr=\`git ls-remote #{self[:repository]} refs/heads/#{branch}\`; "
96
96
 
97
97
  if self[:deploy_config_to]
98
98
  check += "cd #{self[:deploy_config_to]}; " +
99
- "cl=\`cat .git/refs/heads/#{config_branch}\`; " +
99
+ "cl=\`git log -1 --pretty=format:%H\`; " +
100
100
  "cr=\`git ls-remote #{self[:config_repository]} refs/heads/#{config_branch}\`; "
101
101
  end
102
102
 
@@ -258,7 +258,7 @@ class WhiskeyDisk
258
258
  def snapshot_git_revision
259
259
  needs(:deploy_to)
260
260
  enqueue "cd #{self[:deploy_to]}"
261
- enqueue %Q{ml=\`cat .git/refs/heads/#{branch}\`}
261
+ enqueue %Q{ml=\`git log -1 --pretty=format:%H\`}
262
262
  end
263
263
 
264
264
  def initialize_git_changes
@@ -342,15 +342,15 @@ describe 'WhiskeyDisk' do
342
342
  WhiskeyDisk.buffer.join(' ').should.match(%r{rm -f /path/to/main/repo/.whiskey_disk_git_changes})
343
343
  end
344
344
 
345
- it 'should capture the current git HEAD ref for the specified branch' do
345
+ it 'should capture the current git HEAD ref for the current branch' do
346
346
  WhiskeyDisk.configuration = @parameters.merge({'branch' => 'production'})
347
347
  WhiskeyDisk.update_main_repository_checkout
348
- WhiskeyDisk.buffer.join(' ').should.match(%r{ml=\`cat .git/refs/heads/production\`})
348
+ WhiskeyDisk.buffer.join(' ').should.match(%r{ml=\`git log -1 --pretty=format:%H\`})
349
349
  end
350
350
 
351
- it 'should capture the current git HEAD ref for the master branch if no branch is specified' do
351
+ it 'should capture the current git HEAD ref for the current branch if no branch is specified' do
352
352
  WhiskeyDisk.update_main_repository_checkout
353
- WhiskeyDisk.buffer.join(' ').should.match(%r{ml=\`cat .git/refs/heads/master\`})
353
+ WhiskeyDisk.buffer.join(' ').should.match(%r{ml=\`git log -1 --pretty=format:%H\`})
354
354
  end
355
355
 
356
356
  it 'should attempt to fetch only the master branch from the origin if no branch is specified' do
@@ -800,16 +800,16 @@ describe 'WhiskeyDisk' do
800
800
  WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("then { COMMAND ; }; else echo \"No changes to deploy.\"; fi")))
801
801
  end
802
802
 
803
- it "should query the head of the main checkout's master branch if no branch is specified" do
803
+ it "should query the head of the main checkout's current branch if no branch is specified" do
804
804
  WhiskeyDisk.enqueue("COMMAND")
805
- WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("cd #{@deploy_to}; ml=\`cat .git/refs/heads/master\`;")))
805
+ WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("cd #{@deploy_to}; ml=\`git log -1 --pretty=format:%H\`;")))
806
806
  end
807
807
 
808
- it "should query the head of the main checkout's specified branch if a branch is specified" do
808
+ it "should query the head of the main checkout's current branch if a branch is specified" do
809
809
  WhiskeyDisk.configuration = @parameters.merge({'branch' => 'production'})
810
810
  WhiskeyDisk.enable_staleness_checks
811
811
  WhiskeyDisk.enqueue("COMMAND")
812
- WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("cd #{@deploy_to}; ml=\`cat .git/refs/heads/production\`;")))
812
+ WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("cd #{@deploy_to}; ml=\`git log -1 --pretty=format:%H\`;")))
813
813
  end
814
814
 
815
815
  it "should query the head on the main repository's master branch if no branch is specified" do
@@ -864,16 +864,16 @@ describe 'WhiskeyDisk' do
864
864
  WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("then { COMMAND ; }; else echo \"No changes to deploy.\"; fi")))
865
865
  end
866
866
 
867
- it "should query the head of the main checkout's master branch if no branch is specified" do
867
+ it "should query the head of the main checkout's current branch if no branch is specified" do
868
868
  WhiskeyDisk.enqueue("COMMAND")
869
- WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("cd #{@deploy_to}; ml=\`cat .git/refs/heads/master\`;")))
869
+ WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("cd #{@deploy_to}; ml=\`git log -1 --pretty=format:%H\`;")))
870
870
  end
871
871
 
872
- it "should query the head of the main checkout's specified branch if a branch is specified" do
872
+ it "should query the head of the main checkout's current branch if a branch is specified" do
873
873
  WhiskeyDisk.configuration = @parameters.merge({'branch' => 'production'})
874
874
  WhiskeyDisk.enable_staleness_checks
875
875
  WhiskeyDisk.enqueue("COMMAND")
876
- WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("cd #{@deploy_to}; ml=\`cat .git/refs/heads/production\`;")))
876
+ WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("cd #{@deploy_to}; ml=\`git log -1 --pretty=format:%H\`;")))
877
877
  end
878
878
 
879
879
  it "should query the head on the main repository's master branch if no branch is specified" do
@@ -888,16 +888,16 @@ describe 'WhiskeyDisk' do
888
888
  WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("mr=\`git ls-remote #{@repository} refs/heads/production\`;")))
889
889
  end
890
890
 
891
- it "should query the head of the config checkout's master branch if no branch is specified" do
891
+ it "should query the head of the config checkout's current branch if no branch is specified" do
892
892
  WhiskeyDisk.enqueue("COMMAND")
893
- WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("cd #{@deploy_config_to}; cl=\`cat .git/refs/heads/master\`;")))
893
+ WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("cd #{@deploy_config_to}; cl=\`git log -1 --pretty=format:%H\`;")))
894
894
  end
895
895
 
896
- it "should query the head of the config checkout's specified branch if a branch is specified" do
896
+ it "should query the head of the config checkout's current branch if a branch is specified" do
897
897
  WhiskeyDisk.configuration = @parameters.merge({'config_branch' => 'production'})
898
898
  WhiskeyDisk.enable_staleness_checks
899
899
  WhiskeyDisk.enqueue("COMMAND")
900
- WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("cd #{@deploy_config_to}; cl=\`cat .git/refs/heads/production\`;")))
900
+ WhiskeyDisk.bundle.should.match(Regexp.new(Regexp.escape("cd #{@deploy_config_to}; cl=\`git log -1 --pretty=format:%H\`;")))
901
901
  end
902
902
 
903
903
  it "should query the head on the config repository's master branch if no branch is specified" do
data/whiskey_disk.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{whiskey_disk}
8
- s.version = "0.6.21"
8
+ s.version = "0.6.22"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rick Bradley"]
12
- s.date = %q{2011-04-06}
12
+ s.date = %q{2011-04-10}
13
13
  s.description = %q{Opinionated gem for doing fast git-based server deployments.}
14
14
  s.email = %q{rick@rickbradley.com}
15
15
  s.executables = ["wd_role", "wd"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whiskey_disk
3
3
  version: !ruby/object:Gem::Version
4
- hash: 45
4
+ hash: 43
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 21
10
- version: 0.6.21
9
+ - 22
10
+ version: 0.6.22
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rick Bradley
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-06 00:00:00 -05:00
18
+ date: 2011-04-10 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency