cucumber-chef 2.1.0.rc.2 → 2.1.0.rc.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/cc-knife +2 -3
- data/bin/cc-push +7 -15
- data/bin/cc-server +38 -7
- data/bin/cucumber-chef +179 -119
- data/cucumber-chef.gemspec +1 -1
- data/lib/cucumber/chef.rb +2 -2
- data/lib/cucumber/chef/config.rb +24 -16
- data/lib/cucumber/chef/helpers.rb +0 -2
- data/lib/cucumber/chef/helpers/chef_client.rb +20 -23
- data/lib/cucumber/chef/helpers/chef_server.rb +7 -7
- data/lib/cucumber/chef/helpers/command.rb +20 -33
- data/lib/cucumber/chef/helpers/container.rb +55 -22
- data/lib/cucumber/chef/helpers/server.rb +45 -31
- data/lib/cucumber/chef/helpers/test_lab.rb +8 -2
- data/lib/cucumber/chef/helpers/utility.rb +2 -23
- data/lib/cucumber/chef/provider.rb +24 -19
- data/lib/cucumber/chef/providers/aws.rb +90 -121
- data/lib/cucumber/chef/providers/vagrant.rb +92 -36
- data/lib/cucumber/chef/provisioner.rb +52 -94
- data/lib/cucumber/chef/server.rb +42 -36
- data/lib/cucumber/chef/steps/provision_steps.rb +7 -7
- data/lib/cucumber/chef/steps/ssh_steps.rb +9 -4
- data/lib/cucumber/chef/templates/bootstrap/ubuntu-precise-test-lab.erb +13 -7
- data/lib/cucumber/chef/templates/cucumber/cc-hooks.rb +1 -1
- data/lib/cucumber/chef/test_lab.rb +38 -9
- data/lib/cucumber/chef/utility.rb +55 -48
- data/lib/cucumber/chef/version.rb +1 -1
- data/spec/cucumber/chef/config_spec.rb +8 -8
- metadata +11 -12
- data/lib/cucumber/chef/bootstrap.rb +0 -95
@@ -24,7 +24,7 @@ module Cucumber
|
|
24
24
|
|
25
25
|
################################################################################
|
26
26
|
|
27
|
-
VERSION = "2.1.0.rc.
|
27
|
+
VERSION = "2.1.0.rc.3" unless const_defined?(:VERSION)
|
28
28
|
|
29
29
|
################################################################################
|
30
30
|
|
@@ -46,8 +46,8 @@ describe Cucumber::Chef::Config do
|
|
46
46
|
Cucumber::Chef::Config[:mode].should == :user
|
47
47
|
end
|
48
48
|
|
49
|
-
it "Cucumber::Chef::Config
|
50
|
-
Cucumber::Chef::Config
|
49
|
+
it "Cucumber::Chef::Config.provider defaults to :vagrant" do
|
50
|
+
Cucumber::Chef::Config.provider.should == :vagrant
|
51
51
|
end
|
52
52
|
|
53
53
|
context "Cucumber::Chef::Config[:aws] default values" do
|
@@ -112,10 +112,10 @@ describe Cucumber::Chef::Config do
|
|
112
112
|
describe "when configuration is valid" do
|
113
113
|
|
114
114
|
it "should allow changing providers" do
|
115
|
-
Cucumber::Chef::Config
|
115
|
+
Cucumber::Chef::Config.provider = :aws
|
116
116
|
expect{ Cucumber::Chef::Config.verify_keys }.to_not raise_error(Cucumber::Chef::ConfigError)
|
117
117
|
|
118
|
-
Cucumber::Chef::Config
|
118
|
+
Cucumber::Chef::Config.provider = :vagrant
|
119
119
|
expect{ Cucumber::Chef::Config.verify_keys }.to_not raise_error(Cucumber::Chef::ConfigError)
|
120
120
|
end
|
121
121
|
|
@@ -131,7 +131,7 @@ describe Cucumber::Chef::Config do
|
|
131
131
|
context "when provider is aws" do
|
132
132
|
it "should verify the configuration" do
|
133
133
|
user = ENV['OPSCODE_USER'] || ENV['USER']
|
134
|
-
Cucumber::Chef::Config
|
134
|
+
Cucumber::Chef::Config.provider = :aws
|
135
135
|
Cucumber::Chef::Config[:aws][:aws_access_key_id] = ENV['AWS_ACCESS_KEY_ID']
|
136
136
|
Cucumber::Chef::Config[:aws][:aws_secret_access_key] = ENV['AWS_SECRET_ACCESS_KEY']
|
137
137
|
Cucumber::Chef::Config[:aws][:aws_ssh_key_id] = ENV['AWS_SSH_KEY_ID'] || user
|
@@ -149,7 +149,7 @@ describe Cucumber::Chef::Config do
|
|
149
149
|
describe "when configuration is invalid" do
|
150
150
|
|
151
151
|
it "should complain about missing configuration keys" do
|
152
|
-
Cucumber::Chef::Config
|
152
|
+
Cucumber::Chef::Config.provider = nil
|
153
153
|
expect{ Cucumber::Chef::Config.verify_keys }.to raise_error(Cucumber::Chef::ConfigError)
|
154
154
|
|
155
155
|
Cucumber::Chef::Config[:mode] = nil
|
@@ -157,7 +157,7 @@ describe Cucumber::Chef::Config do
|
|
157
157
|
end
|
158
158
|
|
159
159
|
it "should complain about invalid configuration key values" do
|
160
|
-
Cucumber::Chef::Config
|
160
|
+
Cucumber::Chef::Config.provider = :awss
|
161
161
|
expect{ Cucumber::Chef::Config.verify_keys }.to raise_error(Cucumber::Chef::ConfigError)
|
162
162
|
|
163
163
|
Cucumber::Chef::Config[:mode] = :userr
|
@@ -167,7 +167,7 @@ describe Cucumber::Chef::Config do
|
|
167
167
|
describe "when provider is aws" do
|
168
168
|
|
169
169
|
it "should complain about missing provider configuration keys" do
|
170
|
-
Cucumber::Chef::Config
|
170
|
+
Cucumber::Chef::Config.provider = :aws
|
171
171
|
expect{ Cucumber::Chef::Config.verify_provider_keys }.to raise_error(Cucumber::Chef::ConfigError)
|
172
172
|
end
|
173
173
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.0.rc.
|
4
|
+
version: 2.1.0.rc.3
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-01-
|
13
|
+
date: 2013-01-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: chef
|
@@ -93,13 +93,13 @@ dependencies:
|
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: 2.10.0
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
96
|
+
name: mixlib-config
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
98
98
|
none: false
|
99
99
|
requirements:
|
100
100
|
- - ! '>='
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
102
|
+
version: 1.1.2
|
103
103
|
type: :runtime
|
104
104
|
prerelease: false
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -107,15 +107,15 @@ dependencies:
|
|
107
107
|
requirements:
|
108
108
|
- - ! '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 1.1.2
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
none: false
|
115
115
|
requirements:
|
116
116
|
- - ! '>='
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
118
|
+
version: 0.9.2
|
119
119
|
type: :runtime
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -123,15 +123,15 @@ dependencies:
|
|
123
123
|
requirements:
|
124
124
|
- - ! '>='
|
125
125
|
- !ruby/object:Gem::Version
|
126
|
-
version:
|
126
|
+
version: 0.9.2
|
127
127
|
- !ruby/object:Gem::Dependency
|
128
|
-
name:
|
128
|
+
name: thor
|
129
129
|
requirement: !ruby/object:Gem::Requirement
|
130
130
|
none: false
|
131
131
|
requirements:
|
132
132
|
- - ! '>='
|
133
133
|
- !ruby/object:Gem::Version
|
134
|
-
version: 0.
|
134
|
+
version: 0.15.2
|
135
135
|
type: :runtime
|
136
136
|
prerelease: false
|
137
137
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -139,7 +139,7 @@ dependencies:
|
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
141
141
|
- !ruby/object:Gem::Version
|
142
|
-
version: 0.
|
142
|
+
version: 0.15.2
|
143
143
|
- !ruby/object:Gem::Dependency
|
144
144
|
name: ubuntu_ami
|
145
145
|
requirement: !ruby/object:Gem::Requirement
|
@@ -297,7 +297,6 @@ files:
|
|
297
297
|
- features/usage.feature
|
298
298
|
- lib/cucumber-chef.rb
|
299
299
|
- lib/cucumber/chef.rb
|
300
|
-
- lib/cucumber/chef/bootstrap.rb
|
301
300
|
- lib/cucumber/chef/config.rb
|
302
301
|
- lib/cucumber/chef/helpers.rb
|
303
302
|
- lib/cucumber/chef/helpers/chef_client.rb
|
@@ -1,95 +0,0 @@
|
|
1
|
-
################################################################################
|
2
|
-
#
|
3
|
-
# Author: Stephen Nelson-Smith <stephen@atalanta-systems.com>
|
4
|
-
# Author: Zachary Patten <zachary@jovelabs.com>
|
5
|
-
# Copyright: Copyright (c) 2011-2013 Atalanta Systems Ltd
|
6
|
-
# License: Apache License, Version 2.0
|
7
|
-
#
|
8
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
-
# you may not use this file except in compliance with the License.
|
10
|
-
# You may obtain a copy of the License at
|
11
|
-
#
|
12
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
#
|
14
|
-
# Unless required by applicable law or agreed to in writing, software
|
15
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
-
# See the License for the specific language governing permissions and
|
18
|
-
# limitations under the License.
|
19
|
-
#
|
20
|
-
################################################################################
|
21
|
-
|
22
|
-
module Cucumber
|
23
|
-
module Chef
|
24
|
-
|
25
|
-
class BootstrapError < Error; end
|
26
|
-
|
27
|
-
class Bootstrap
|
28
|
-
attr_accessor :stdout, :stderr, :stdin, :config
|
29
|
-
|
30
|
-
################################################################################
|
31
|
-
|
32
|
-
def initialize(stdout=STDOUT, stderr=STDERR, stdin=STDIN)
|
33
|
-
@stdout, @stderr, @stdin = stdout, stderr, stdin
|
34
|
-
@stdout.sync = true if @stdout.respond_to?(:sync=)
|
35
|
-
|
36
|
-
@ssh = ZTK::SSH.new(:stdout => @stdout, :stderr => @stderr, :stdin => @stdin)
|
37
|
-
@config = Hash.new(nil)
|
38
|
-
@config[:context] = Hash.new(nil)
|
39
|
-
end
|
40
|
-
|
41
|
-
################################################################################
|
42
|
-
|
43
|
-
def run
|
44
|
-
Cucumber::Chef.logger.debug { "config(#{@config.inspect})" }
|
45
|
-
|
46
|
-
if !@config[:template_file]
|
47
|
-
message = "You must supply a 'template_file' option."
|
48
|
-
Cucumber::Chef.logger.fatal { message }
|
49
|
-
raise BootstrapError, message
|
50
|
-
end
|
51
|
-
|
52
|
-
if !@config[:host]
|
53
|
-
message = "You must supply a 'host' option."
|
54
|
-
Cucumber::Chef.logger.fatal { message }
|
55
|
-
raise BootstrapError, message
|
56
|
-
end
|
57
|
-
|
58
|
-
if !@config[:ssh_user]
|
59
|
-
message = "You must supply a 'ssh_user' option."
|
60
|
-
Cucumber::Chef.logger.fatal { message }
|
61
|
-
raise BootstrapError, message
|
62
|
-
end
|
63
|
-
|
64
|
-
if (!@config[:ssh_password] && !@config[:identity_file])
|
65
|
-
message = "You must supply a 'ssh_password' or 'identity_file' option."
|
66
|
-
Cucumber::Chef.logger.fatal { message }
|
67
|
-
raise BootstrapError, message
|
68
|
-
end
|
69
|
-
|
70
|
-
Cucumber::Chef.logger.debug { "prepare(#{@config[:host]}:#{@config[:port]})" }
|
71
|
-
|
72
|
-
@ssh.config.host_name = @config[:host]
|
73
|
-
@ssh.config.port = @config[:port] if @config[:port]
|
74
|
-
@ssh.config.user = @config[:ssh_user]
|
75
|
-
@ssh.config.password = @config[:ssh_password]
|
76
|
-
@ssh.config.keys = @config[:identity_file]
|
77
|
-
@ssh.config.timeout = 5
|
78
|
-
|
79
|
-
Cucumber::Chef.logger.debug { "template_file(#{@config[:template_file]})" }
|
80
|
-
command = ZTK::Template.render(@config[:template_file], @config[:context])
|
81
|
-
command = "sudo #{command}" if @config[:use_sudo]
|
82
|
-
|
83
|
-
Cucumber::Chef.logger.debug { "begin(#{@config[:host]}:#{@config[:port]})" }
|
84
|
-
@ssh.exec(command, :silence => true)
|
85
|
-
Cucumber::Chef.logger.debug { "end(#{@config[:host]}:#{@config[:port]})" }
|
86
|
-
end
|
87
|
-
|
88
|
-
################################################################################
|
89
|
-
|
90
|
-
end
|
91
|
-
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
################################################################################
|