daptiv-chef-ci 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,7 +43,7 @@ Gem::Specification.new do |gem|
43
43
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
44
44
  gem.name = "daptiv-chef-ci"
45
45
  gem.require_paths = ["lib"]
46
- gem.version = '0.0.11'
46
+ gem.version = '0.0.12'
47
47
 
48
48
  gem.add_runtime_dependency "log4r", "~> 1.1.10"
49
49
  gem.add_runtime_dependency "mixlib-shellout", "~> 1.2.0"
@@ -20,12 +20,14 @@ class VagrantDestroy
20
20
 
21
21
  attr_accessor :vagrant_driver
22
22
  attr_accessor :destroy_timeout_in_seconds
23
+ attr_accessor :environment
23
24
 
24
25
  # @param [String] name The task name.
25
26
  # @param [String] desc Description of the task.
26
27
  def initialize(name = 'vagrant_destroy', desc = 'Vagrant destroy task')
27
28
  @name, @desc = name, desc
28
29
  @destroy_timeout_in_seconds = 180
30
+ @environment = {}
29
31
  yield self if block_given?
30
32
  define_task
31
33
  end
@@ -35,7 +37,9 @@ class VagrantDestroy
35
37
  def define_task
36
38
  desc @desc
37
39
  task @name do
38
- execute { vagrant_driver.destroy({ :cmd_timeout_in_seconds => @destroy_timeout_in_seconds }) }
40
+ execute { vagrant_driver.destroy({
41
+ :cmd_timeout_in_seconds => @destroy_timeout_in_seconds,
42
+ :environment => @environment }) }
39
43
  end
40
44
  end
41
45
 
@@ -88,15 +88,24 @@ class Vagrant
88
88
  end
89
89
 
90
90
  def package()
91
- vagrant_driver.package({ :base_dir => @vagrantfile_dir, :box_name => @box_name })
91
+ vagrant_driver.package({
92
+ :base_dir => @vagrantfile_dir,
93
+ :box_name => @box_name,
94
+ :environment => @environment })
92
95
  end
93
96
 
94
97
  def destroy()
95
- vagrant_driver.destroy({ :cmd_timeout_in_seconds => @destroy_timeout_in_seconds, :retry_attempts => @destroy_retry_attempts })
98
+ vagrant_driver.destroy({
99
+ :cmd_timeout_in_seconds => @destroy_timeout_in_seconds,
100
+ :retry_attempts => @destroy_retry_attempts,
101
+ :environment => @environment })
96
102
  end
97
103
 
98
104
  def halt()
99
- vagrant_driver.halt({ :cmd_timeout_in_seconds => @halt_timeout_in_seconds, :retry_attempts => @halt_retry_attempts })
105
+ vagrant_driver.halt({
106
+ :cmd_timeout_in_seconds => @halt_timeout_in_seconds,
107
+ :retry_attempts => @halt_retry_attempts,
108
+ :environment => @environment })
100
109
  end
101
110
 
102
111
  def vagrant_driver()
@@ -7,7 +7,7 @@ describe VagrantDestroy::RakeTask, :unit => true do
7
7
  describe 'vagrant_destroy' do
8
8
  it 'should destroy the box' do
9
9
 
10
- vagrant_driver.should_receive(:destroy).with({ :cmd_timeout_in_seconds => 180 })
10
+ vagrant_driver.should_receive(:destroy).with({ :cmd_timeout_in_seconds => 180, :environment => {} })
11
11
 
12
12
  task = rake['vagrant_destroy']
13
13
  task.invoke()
@@ -7,10 +7,10 @@ describe Vagrant::RakeTask, :unit => true do
7
7
  describe 'vagrant' do
8
8
  it 'should destroy, up, halt, then destroy the box' do
9
9
 
10
- vagrant_driver.should_receive(:destroy).with({ :cmd_timeout_in_seconds => 180, :retry_attempts => 2 })
10
+ vagrant_driver.should_receive(:destroy).with({ :cmd_timeout_in_seconds => 180, :retry_attempts => 2, :environment => {} })
11
11
  vagrant_driver.should_receive(:up).with({ :cmd_timeout_in_seconds => 7200, :environment => {} })
12
- vagrant_driver.should_receive(:halt).at_least(1).times.with({ :cmd_timeout_in_seconds => 180, :retry_attempts => 2 })
13
- vagrant_driver.should_receive(:destroy).with({ :cmd_timeout_in_seconds => 180, :retry_attempts => 2 })
12
+ vagrant_driver.should_receive(:halt).at_least(1).times.with({ :cmd_timeout_in_seconds => 180, :retry_attempts => 2, :environment => {} })
13
+ vagrant_driver.should_receive(:destroy).with({ :cmd_timeout_in_seconds => 180, :retry_attempts => 2, :environment => {} })
14
14
 
15
15
  task = rake['vagrant']
16
16
  task.invoke()
@@ -21,10 +21,14 @@ describe Vagrant::RakeTask, :unit => true do
21
21
 
22
22
  environment = { :ENV_VAR1 => 'val1', :ENV_VAR2 => 'val2' }
23
23
 
24
- vagrant_driver.should_receive(:destroy).with({ :cmd_timeout_in_seconds => 180, :retry_attempts => 2 })
25
- vagrant_driver.should_receive(:up).with({ :cmd_timeout_in_seconds => 7200, :environment => environment })
26
- vagrant_driver.should_receive(:halt).at_least(1).times.with({ :cmd_timeout_in_seconds => 180, :retry_attempts => 2 })
27
- vagrant_driver.should_receive(:destroy).with({ :cmd_timeout_in_seconds => 180, :retry_attempts => 2 })
24
+ vagrant_driver.should_receive(:destroy).with({
25
+ :cmd_timeout_in_seconds => 180, :retry_attempts => 2, :environment => environment })
26
+ vagrant_driver.should_receive(:up).with({
27
+ :cmd_timeout_in_seconds => 7200, :environment => environment })
28
+ vagrant_driver.should_receive(:halt).at_least(1).times.with({
29
+ :cmd_timeout_in_seconds => 180, :retry_attempts => 2, :environment => environment })
30
+ vagrant_driver.should_receive(:destroy).with({
31
+ :cmd_timeout_in_seconds => 180, :retry_attempts => 2, :environment => environment })
28
32
 
29
33
  task = rake['vagrant']
30
34
  subject.environment = environment
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daptiv-chef-ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-12 00:00:00.000000000 Z
12
+ date: 2013-11-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: log4r
@@ -128,16 +128,6 @@ files:
128
128
  - lib/daptiv-chef-ci/virtualbox_basebox_builder.rb
129
129
  - lib/daptiv-chef-ci/virtualbox_driver.rb
130
130
  - lib/daptiv-chef-ci/vmware_basebox_builder.rb
131
- - pkg/daptiv-chef-ci-0.0.1.gem
132
- - pkg/daptiv-chef-ci-0.0.10.gem
133
- - pkg/daptiv-chef-ci-0.0.2.gem
134
- - pkg/daptiv-chef-ci-0.0.3.gem
135
- - pkg/daptiv-chef-ci-0.0.4.gem
136
- - pkg/daptiv-chef-ci-0.0.5.gem
137
- - pkg/daptiv-chef-ci-0.0.6.gem
138
- - pkg/daptiv-chef-ci-0.0.7.gem
139
- - pkg/daptiv-chef-ci-0.0.8.gem
140
- - pkg/daptiv-chef-ci-0.0.9.gem
141
131
  - Rakefile
142
132
  - README.md
143
133
  - spec/daptiv-chef-ci/basebox_builder_factory_spec.rb
@@ -167,7 +157,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
157
  version: '0'
168
158
  segments:
169
159
  - 0
170
- hash: 4467900760227651610
160
+ hash: 2136130204737791091
171
161
  required_rubygems_version: !ruby/object:Gem::Requirement
172
162
  none: false
173
163
  requirements:
@@ -176,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
166
  version: '0'
177
167
  segments:
178
168
  - 0
179
- hash: 4467900760227651610
169
+ hash: 2136130204737791091
180
170
  requirements: []
181
171
  rubyforge_project:
182
172
  rubygems_version: 1.8.23