whiskey_disk 0.6.12 → 0.6.13

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,13 @@
1
1
 
2
+ 0.6.13 / 2011-02-20
3
+ ==================
4
+
5
+ * pass rake_env settings to post_* scripts
6
+ * Finish basic integration specs for post_* scripts
7
+ * should fail when post_* scripts are specified but missing
8
+ * basic integration specs for post_* scripts
9
+ * updating integration spec git repo data
10
+
2
11
  0.6.12 / 2011-02-20
3
12
  ==================
4
13
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.12
1
+ 0.6.13
data/lib/whiskey_disk.rb CHANGED
@@ -215,8 +215,7 @@ class WhiskeyDisk
215
215
 
216
216
  def run_script(script)
217
217
  return unless script
218
- path = build_path(script)
219
- enqueue("if [ -e #{path} ]; then cd #{self[:deploy_to]}; sh -x #{path}; fi ")
218
+ enqueue(%Q<cd #{self[:deploy_to]}; echo "Running post script..."; #{env_vars} sh -x #{build_path(script)}>)
220
219
  end
221
220
 
222
221
  def ensure_main_parent_path_is_present
@@ -379,7 +379,7 @@ describe 'WhiskeyDisk' do
379
379
  describe 'when a post setup script is specified' do
380
380
  describe 'and the script path does not start with a "/"' do
381
381
  before do
382
- WhiskeyDisk.configuration = { 'deploy_to' => '/path/to/main/repo', 'post_setup_script' => '/path/to/setup/script' }
382
+ WhiskeyDisk.configuration = { 'deploy_to' => '/path/to/main/repo', 'post_setup_script' => '/path/to/setup/script', 'rake_env' => { 'FOO' => 'BAR' } }
383
383
  end
384
384
 
385
385
  it 'should attempt to run the post setup script' do
@@ -387,25 +387,25 @@ describe 'WhiskeyDisk' do
387
387
  WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x .*/path/to/setup/script})
388
388
  end
389
389
 
390
+ it 'should pass any environment variables when running the post setup script' do
391
+ WhiskeyDisk.run_post_setup_hooks
392
+ WhiskeyDisk.buffer.join(' ').should.match(%r{FOO='BAR' sh -x .*/path/to/setup/script})
393
+ end
394
+
390
395
  it 'should cd to the deploy_to path prior to running the script' do
391
396
  WhiskeyDisk.run_post_setup_hooks
392
- WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo; sh -x /path/to/setup/script})
397
+ WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo;.*sh -x /path/to/setup/script})
393
398
  end
394
399
 
395
400
  it 'should use an absolute path to run the post setup script when the script path starts with a "/"' do
396
401
  WhiskeyDisk.run_post_setup_hooks
397
402
  WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x /path/to/setup/script})
398
403
  end
399
-
400
- it 'should make the post setup script run conditional on the presence of the script' do
401
- WhiskeyDisk.run_post_setup_hooks
402
- WhiskeyDisk.buffer.join(' ').should.match(%r{if \[ -e /path/to/setup/script \]; then .*; fi})
403
- end
404
404
  end
405
405
 
406
406
  describe 'and the script path does not start with a "/"' do
407
407
  before do
408
- WhiskeyDisk.configuration = { 'deploy_to' => '/path/to/main/repo', 'post_setup_script' => 'path/to/setup/script' }
408
+ WhiskeyDisk.configuration = { 'deploy_to' => '/path/to/main/repo', 'post_setup_script' => 'path/to/setup/script', 'rake_env' => { 'FOO' => 'BAR' } }
409
409
  end
410
410
 
411
411
  it 'should attempt to run the post setup script' do
@@ -413,20 +413,20 @@ describe 'WhiskeyDisk' do
413
413
  WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x .*/path/to/setup/script})
414
414
  end
415
415
 
416
+ it 'should pass any environment variables when running the post setup script' do
417
+ WhiskeyDisk.run_post_setup_hooks
418
+ WhiskeyDisk.buffer.join(' ').should.match(%r{FOO='BAR' sh -x .*/path/to/setup/script})
419
+ end
420
+
416
421
  it 'should cd to the deploy_to path prior to running the script' do
417
422
  WhiskeyDisk.run_post_setup_hooks
418
- WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo; sh -x /path/to/main/repo/path/to/setup/script})
423
+ WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo;.*sh -x /path/to/main/repo/path/to/setup/script})
419
424
  end
420
425
 
421
426
  it 'should use a path relative to the setup path to run the post setup script' do
422
427
  WhiskeyDisk.run_post_setup_hooks
423
428
  WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x /path/to/main/repo/path/to/setup/script})
424
429
  end
425
-
426
- it 'should make the post setup script run conditional on the presence of the script' do
427
- WhiskeyDisk.run_post_setup_hooks
428
- WhiskeyDisk.buffer.join(' ').should.match(%r{if \[ -e /path/to/main/repo/path/to/setup/script \]; then .*; fi})
429
- end
430
430
  end
431
431
  end
432
432
 
@@ -487,7 +487,7 @@ describe 'WhiskeyDisk' do
487
487
  describe 'when a post deployment script is specified' do
488
488
  describe 'and the script path does not start with a "/"' do
489
489
  before do
490
- WhiskeyDisk.configuration = { 'deploy_to' => '/path/to/main/repo', 'post_deploy_script' => '/path/to/deployment/script' }
490
+ WhiskeyDisk.configuration = { 'deploy_to' => '/path/to/main/repo', 'post_deploy_script' => '/path/to/deployment/script', 'rake_env' => { 'FOO' => 'BAR' } }
491
491
  end
492
492
 
493
493
  it 'should attempt to run the post deployment script' do
@@ -495,25 +495,25 @@ describe 'WhiskeyDisk' do
495
495
  WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x .*/path/to/deployment/script})
496
496
  end
497
497
 
498
+ it 'should pass any environment variables when running the post deploy script' do
499
+ WhiskeyDisk.run_post_deploy_hooks
500
+ WhiskeyDisk.buffer.join(' ').should.match(%r{FOO='BAR' sh -x .*/path/to/deployment/script})
501
+ end
502
+
498
503
  it 'should cd to the deploy_to path prior to running the script' do
499
504
  WhiskeyDisk.run_post_deploy_hooks
500
- WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo; sh -x /path/to/deployment/script})
505
+ WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo;.*sh -x /path/to/deployment/script})
501
506
  end
502
507
 
503
508
  it 'should use an absolute path to run the post deployment script when the script path starts with a "/"' do
504
509
  WhiskeyDisk.run_post_deploy_hooks
505
510
  WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x /path/to/deployment/script})
506
511
  end
507
-
508
- it 'should make the post deployment script run conditional on the presence of the script' do
509
- WhiskeyDisk.run_post_deploy_hooks
510
- WhiskeyDisk.buffer.join(' ').should.match(%r{if \[ -e /path/to/deployment/script \]; then .*; fi})
511
- end
512
512
  end
513
513
 
514
514
  describe 'and the script path does not start with a "/"' do
515
515
  before do
516
- WhiskeyDisk.configuration = { 'deploy_to' => '/path/to/main/repo', 'post_deploy_script' => 'path/to/deployment/script' }
516
+ WhiskeyDisk.configuration = { 'deploy_to' => '/path/to/main/repo', 'post_deploy_script' => 'path/to/deployment/script', 'rake_env' => { 'FOO' => 'BAR' } }
517
517
  end
518
518
 
519
519
  it 'should attempt to run the post deployment script' do
@@ -521,20 +521,20 @@ describe 'WhiskeyDisk' do
521
521
  WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x .*/path/to/deployment/script})
522
522
  end
523
523
 
524
+ it 'should pass any environment variables when running the post deploy script' do
525
+ WhiskeyDisk.run_post_deploy_hooks
526
+ WhiskeyDisk.buffer.join(' ').should.match(%r{FOO='BAR' sh -x .*/path/to/deployment/script})
527
+ end
528
+
524
529
  it 'should cd to the deploy_to path prior to running the script' do
525
530
  WhiskeyDisk.run_post_deploy_hooks
526
- WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo; sh -x /path/to/main/repo/path/to/deployment/script})
531
+ WhiskeyDisk.buffer.join(' ').should.match(%r{cd /path/to/main/repo;.*sh -x /path/to/main/repo/path/to/deployment/script})
527
532
  end
528
533
 
529
534
  it 'should use a path relative to the deployment path to run the post deployment script' do
530
535
  WhiskeyDisk.run_post_deploy_hooks
531
536
  WhiskeyDisk.buffer.join(' ').should.match(%r{sh -x /path/to/main/repo/path/to/deployment/script})
532
537
  end
533
-
534
- it 'should make the post deployment script run conditional on the presence of the script' do
535
- WhiskeyDisk.run_post_deploy_hooks
536
- WhiskeyDisk.buffer.join(' ').should.match(%r{if \[ -e /path/to/main/repo/path/to/deployment/script \]; then .*; fi})
537
- end
538
538
  end
539
539
  end
540
540
 
data/whiskey_disk.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{whiskey_disk}
8
- s.version = "0.6.12"
8
+ s.version = "0.6.13"
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"]
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: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 12
10
- version: 0.6.12
9
+ - 13
10
+ version: 0.6.13
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rick Bradley