whiskey_disk 0.6.14 → 0.6.15

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,4 +1,12 @@
1
1
 
2
+ 0.6.15 / 2011-03-07
3
+ ==================
4
+
5
+ * integration specs for "git checkout #{branch}" functionality
6
+ * adding scenario to test git checkout on non-master branches
7
+ * Adding current_branch integration spec helper method
8
+ * Ensure specified branch is checked out before applying the refresh
9
+
2
10
  0.6.14 / 2011-02-23
3
11
  ==================
4
12
 
data/README.markdown CHANGED
@@ -345,8 +345,6 @@ Whiskey\_disk includes a helper library for use in rake tasks and other ruby scr
345
345
  find a ruby function 'role?' which returns true if you're currently being deployed to a domain with the given
346
346
  role. For example:
347
347
 
348
- <code>
349
-
350
348
  require 'whiskey_disk/helpers'
351
349
 
352
350
  namespace :deploy do
@@ -384,7 +382,6 @@ role. For example:
384
382
  task :post_setup => [ :create_rails_directories ]
385
383
  task :post_deploy => [ :db_migrate_if_necessary, :thinking_sphinx_restart, :bounce_passenger ]
386
384
  end
387
- </code>
388
385
 
389
386
 
390
387
  #### When working with the shell ####
@@ -710,8 +707,6 @@ Notice that there are no separate trees for 'uat' and 'qa' targets.
710
707
 
711
708
  - Here is a sample of a lib/tasks/deploy.rake from a Rails application we deployed once upon a time:
712
709
 
713
- <code>
714
-
715
710
  RAILS_ENV=ENV['RAILS_ENV'] if ENV['RAILS_ENV'] and '' != ENV['RAILS_ENV']
716
711
  Rake::Task['environment'].invoke
717
712
 
@@ -750,7 +745,6 @@ Notice that there are no separate trees for 'uat' and 'qa' targets.
750
745
  task :post_setup => [ :create_rails_directories, :setup_postgres_for_thinking_sphinx ]
751
746
  task :post_deploy => [ 'db:migrate', 'ts:config', :thinking_sphinx_restart, :bounce_passenger, :clear_asset_cache ]
752
747
  end
753
- </code>
754
748
 
755
749
  ### Future Directions ###
756
750
 
@@ -768,7 +762,7 @@ to see what we have in mind for the near future.
768
762
 
769
763
  - Rick Bradley (rick@rickbradley.com, github:rick)
770
764
  - Jeremy Holland (jeremy@jeremypholland.com, github:therubyneck): feature/bugfix contributions
771
- - Kevin Barnes (@vinbarnes), Yossef Mendellsohn (cardioid) for design help and proofreading
765
+ - Kevin Barnes (@vinbarnes), Yossef Mendelssohn (cardioid) for design help and proofreading
772
766
  - Alex Sharp (ajsharp@gmail.com) - issues, real-world usage cases, design feedback
773
767
  - Josh Moore (josh@codingforrent.com) - tracking down issues handling bad project Rakefiles
774
768
  - Cristi Balan (evilchelu) for feedback and proofreading
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.14
1
+ 0.6.15
data/lib/whiskey_disk.rb CHANGED
@@ -199,6 +199,7 @@ class WhiskeyDisk
199
199
  def refresh_checkout(path, repo_branch)
200
200
  enqueue "cd #{path}"
201
201
  enqueue "git fetch origin +refs/heads/#{repo_branch}:refs/remotes/origin/#{repo_branch}"
202
+ enqueue "git checkout #{repo_branch}"
202
203
  enqueue "git reset --hard origin/#{repo_branch}"
203
204
  end
204
205
 
data/spec/spec_helper.rb CHANGED
@@ -63,4 +63,8 @@ end
63
63
 
64
64
  def dump_log
65
65
  STDERR.puts("\n\n\n" + File.read(integration_log) + "\n\n\n")
66
+ end
67
+
68
+ def current_branch(path)
69
+ `cd #{deployed_file(path)} && git branch`.split("\n").grep(/^\*/).first.sub(/^\* /, '')
66
70
  end
@@ -266,6 +266,17 @@ describe 'WhiskeyDisk' do
266
266
  WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo})
267
267
  end
268
268
 
269
+ it 'should work from the default branch if no branch is specified' do
270
+ WhiskeyDisk.update_main_repository_checkout
271
+ WhiskeyDisk.buffer.join(' ').should.match(%r{git checkout master})
272
+ end
273
+
274
+ it 'should work from the specified branch if one is specified' do
275
+ WhiskeyDisk.configuration = @parameters.merge({'branch' => 'production'})
276
+ WhiskeyDisk.update_main_repository_checkout
277
+ WhiskeyDisk.buffer.join(' ').should.match(%r{git checkout production})
278
+ end
279
+
269
280
  it 'should attempt to fetch only the master branch from the origin if no branch is specified' do
270
281
  WhiskeyDisk.update_main_repository_checkout
271
282
  WhiskeyDisk.buffer.join(' ').should.match(%r{git fetch origin \+refs/heads/master:refs/remotes/origin/master})
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.14"
8
+ s.version = "0.6.15"
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-02-23}
12
+ s.date = %q{2011-03-07}
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 14
10
- version: 0.6.14
9
+ - 15
10
+ version: 0.6.15
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-02-23 00:00:00 -06:00
18
+ date: 2011-03-07 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency