kitchen-digitalocean 0.8.3 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/kitchen/driver/digitalocean.rb +5 -5
- data/lib/kitchen/driver/digitalocean_version.rb +1 -1
- data/spec/kitchen/driver/digitalocean_spec.rb +32 -24
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78427c396eb24d16b2db9592aa9deaa0b224858c
|
4
|
+
data.tar.gz: b514d8afe3e1c558255adfc2236a3bb11aa5fecd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68800f8ffe2ebfb87b58b9cc2d40930156a32e8b51d0134cc151546cf3632ae690fc6a5f129ba9aba1704f55c3fa33436d5be05a775fcb4c64b26b0b2cb5ddbd
|
7
|
+
data.tar.gz: c31f73d02199d4b08c5bd83a0f2c58ed55577bdd8ee5d310f90264fbedbd231247034c50d1fdb014e0fa9bcbaa8ffb6b617563991bfd6b68167a72c54fc36e08
|
data/CHANGELOG.md
CHANGED
@@ -37,6 +37,7 @@ module Kitchen
|
|
37
37
|
default_config(:server_name) { |driver| driver.default_name }
|
38
38
|
default_config :private_networking, true
|
39
39
|
default_config :ipv6, false
|
40
|
+
default_config :user_data, nil
|
40
41
|
|
41
42
|
default_config :digitalocean_access_token do
|
42
43
|
ENV['DIGITALOCEAN_ACCESS_TOKEN']
|
@@ -60,13 +61,11 @@ module Kitchen
|
|
60
61
|
sleep 8
|
61
62
|
droplet = client.droplets.find(id: state[:server_id])
|
62
63
|
|
63
|
-
break if droplet
|
64
|
-
&& droplet.networks[:v4] \
|
65
|
-
&& droplet.networks[:v4].any? { |n| n[:type] == 'public' }
|
64
|
+
break if droplet && droplet.networks[:v4] && droplet.networks[:v4].any? { |n| n[:type] == 'public' }
|
66
65
|
end
|
67
66
|
|
68
67
|
state[:hostname] = droplet.networks[:v4]
|
69
|
-
|
68
|
+
.find { |n| n[:type] == 'public' }['ip_address']
|
70
69
|
|
71
70
|
wait_for_sshd(state[:hostname]); print "(ssh ready)\n"
|
72
71
|
debug("digitalocean:create #{state[:hostname]}")
|
@@ -120,7 +119,8 @@ module Kitchen
|
|
120
119
|
size: config[:size],
|
121
120
|
ssh_keys: config[:ssh_key_ids].to_s.split(/, ?/),
|
122
121
|
private_networking: config[:private_networking],
|
123
|
-
ipv6: config[:ipv6]
|
122
|
+
ipv6: config[:ipv6],
|
123
|
+
user_data: config[:user_data]
|
124
124
|
)
|
125
125
|
|
126
126
|
resp = client.droplets.create(droplet)
|
@@ -40,13 +40,11 @@ describe Kitchen::Driver::Digitalocean do
|
|
40
40
|
)
|
41
41
|
end
|
42
42
|
|
43
|
-
let(:driver)
|
44
|
-
d = Kitchen::Driver::Digitalocean.new(config)
|
45
|
-
d.instance = instance
|
46
|
-
d
|
47
|
-
end
|
43
|
+
let(:driver) { described_class.new(config) }
|
48
44
|
|
49
45
|
before(:each) do
|
46
|
+
allow_any_instance_of(described_class).to receive(:instance)
|
47
|
+
.and_return(instance)
|
50
48
|
ENV['DIGITALOCEAN_ACCESS_TOKEN'] = 'access_token'
|
51
49
|
ENV['DIGITALOCEAN_SSH_KEY_IDS'] = '1234'
|
52
50
|
end
|
@@ -95,8 +93,7 @@ describe Kitchen::Driver::Digitalocean do
|
|
95
93
|
username: 'admin',
|
96
94
|
port: '2222',
|
97
95
|
server_name: 'puppy',
|
98
|
-
region: 'ams1'
|
99
|
-
flavor: '1GB'
|
96
|
+
region: 'ams1'
|
100
97
|
}
|
101
98
|
|
102
99
|
let(:config) { config }
|
@@ -114,13 +111,17 @@ describe Kitchen::Driver::Digitalocean do
|
|
114
111
|
double(id: '1234', wait_for: true,
|
115
112
|
public_ip_address: '1.2.3.4')
|
116
113
|
end
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
114
|
+
|
115
|
+
let(:driver) { described_class.new(config) }
|
116
|
+
|
117
|
+
before(:each) do
|
118
|
+
{
|
119
|
+
default_name: 'a_monkey!',
|
120
|
+
create_server: server,
|
121
|
+
wait_for_sshd: '1.2.3.4'
|
122
|
+
}.each do |k, v|
|
123
|
+
allow_any_instance_of(described_class).to receive(k).and_return(v)
|
124
|
+
end
|
124
125
|
end
|
125
126
|
|
126
127
|
context 'username and API key only provided' do
|
@@ -161,11 +162,14 @@ describe Kitchen::Driver::Digitalocean do
|
|
161
162
|
let(:servers) { double(get: server) }
|
162
163
|
let(:compute) { double(servers: servers) }
|
163
164
|
|
164
|
-
let(:driver)
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
165
|
+
let(:driver) { described_class.new(config) }
|
166
|
+
|
167
|
+
before(:each) do
|
168
|
+
{
|
169
|
+
compute: compute
|
170
|
+
}.each do |k, v|
|
171
|
+
allow_any_instance_of(described_class).to receive(k).and_return(v)
|
172
|
+
end
|
169
173
|
end
|
170
174
|
|
171
175
|
context 'a live server that needs to be destroyed' do
|
@@ -196,11 +200,15 @@ describe Kitchen::Driver::Digitalocean do
|
|
196
200
|
s
|
197
201
|
end
|
198
202
|
let(:compute) { double(servers: servers) }
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
203
|
+
|
204
|
+
let(:driver) { described_class.new(config) }
|
205
|
+
|
206
|
+
before(:each) do
|
207
|
+
{
|
208
|
+
compute: compute
|
209
|
+
}.each do |k, v|
|
210
|
+
allow_any_instance_of(described_class).to receive(k).and_return(v)
|
211
|
+
end
|
204
212
|
end
|
205
213
|
|
206
214
|
it 'does not try to destroy the server again' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-digitalocean
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Fitzgerald
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
223
|
rubyforge_project:
|
224
|
-
rubygems_version: 2.4.
|
224
|
+
rubygems_version: 2.4.6
|
225
225
|
signing_key:
|
226
226
|
specification_version: 4
|
227
227
|
summary: A Test Kitchen Driver for Digital Ocean
|