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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14dcfc00a351fbdf44ec5e1c535ee7ed2936d6ab
4
- data.tar.gz: 03363f835f621f45f9b3b32e94c428b32af7cbdc
3
+ metadata.gz: 78427c396eb24d16b2db9592aa9deaa0b224858c
4
+ data.tar.gz: b514d8afe3e1c558255adfc2236a3bb11aa5fecd
5
5
  SHA512:
6
- metadata.gz: bcfdb2045d4a9b55076263f7461f5e5fb16dfd339a5468580b782492c06da36eb9650a8507e441708c39d02a75a7a5db9b60ec96997161c69cefae7daabbcfb8
7
- data.tar.gz: 1e35c146df62423691e232076649843ee6bfd45192212b2931c5446b2047ee2f5e1e287d2d21dbccf5892e0678c022b744bdb453a6d4a39395774017b6371a1b
6
+ metadata.gz: 68800f8ffe2ebfb87b58b9cc2d40930156a32e8b51d0134cc151546cf3632ae690fc6a5f129ba9aba1704f55c3fa33436d5be05a775fcb4c64b26b0b2cb5ddbd
7
+ data.tar.gz: c31f73d02199d4b08c5bd83a0f2c58ed55577bdd8ee5d310f90264fbedbd231247034c50d1fdb014e0fa9bcbaa8ffb6b617563991bfd6b68167a72c54fc36e08
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.9.0 / 2015-04-17
2
+
3
+ * [@juliandunn](https://github.com/juliandunn) [PR #37] Added the ability to pass user_data into droplet creation.
4
+
1
5
  # 0.8.3 / 2014-12-29
2
6
 
3
7
  * [@RoboticCheese](https://github.com/RoboticCheese) [PR #34] make key IDs always a String
@@ -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
- .find { |n| n[:type] == 'public' }['ip_address']
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)
@@ -19,7 +19,7 @@
19
19
  module Kitchen
20
20
  module Driver
21
21
  # Version string for Digital Ocean Kitchen driver
22
- DIGITALOCEAN_VERSION = '0.8.3'
22
+ DIGITALOCEAN_VERSION = '0.9.0'
23
23
  end
24
24
  end
25
25
 
@@ -40,13 +40,11 @@ describe Kitchen::Driver::Digitalocean do
40
40
  )
41
41
  end
42
42
 
43
- let(:driver) do
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
- let(:driver) do
118
- d = Kitchen::Driver::Digitalocean.new(config)
119
- d.instance = instance
120
- allow(d).to receive(:default_name).and_return('a_monkey!')
121
- allow(d).to receive(:create_server).and_return(server)
122
- allow(d).to receive(:wait_for_sshd).with('1.2.3.4').and_return(true)
123
- d
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) do
165
- d = Kitchen::Driver::Digitalocean.new(config)
166
- d.instance = instance
167
- allow(d).to receive(:compute).and_return(compute)
168
- d
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
- let(:driver) do
200
- d = Kitchen::Driver::Digitalocean.new(config)
201
- d.instance = instance
202
- allow(d).to receive(:compute).and_return(compute)
203
- d
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.8.3
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: 2014-12-29 00:00:00.000000000 Z
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.5
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