vagrant-profitbricks 1.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -4
- data/README.md +326 -174
- data/Rakefile +4 -2
- data/Vagrantfile +18 -13
- data/example_box/Vagrantfile +9 -0
- data/example_box/profitbricks.box +0 -0
- data/lib/vagrant-profitbricks.rb +12 -11
- data/lib/vagrant-profitbricks/action.rb +79 -40
- data/lib/vagrant-profitbricks/action/connect_profitbricks.rb +14 -12
- data/lib/vagrant-profitbricks/action/create_server.rb +74 -67
- data/lib/vagrant-profitbricks/action/delete_server.rb +33 -13
- data/lib/vagrant-profitbricks/action/is_created.rb +3 -1
- data/lib/vagrant-profitbricks/action/list_flavors.rb +5 -3
- data/lib/vagrant-profitbricks/action/list_images.rb +6 -4
- data/lib/vagrant-profitbricks/action/message_already_created.rb +4 -2
- data/lib/vagrant-profitbricks/action/message_not_created.rb +4 -2
- data/lib/vagrant-profitbricks/action/read_ssh_info.rb +10 -16
- data/lib/vagrant-profitbricks/action/read_state.rb +19 -12
- data/lib/vagrant-profitbricks/action/reboot_server.rb +45 -0
- data/lib/vagrant-profitbricks/action/run_init_script.rb +5 -3
- data/lib/vagrant-profitbricks/action/start_server.rb +50 -0
- data/lib/vagrant-profitbricks/action/stop_server.rb +51 -0
- data/lib/vagrant-profitbricks/command/datacenters.rb +34 -0
- data/lib/vagrant-profitbricks/command/flavors.rb +19 -6
- data/lib/vagrant-profitbricks/command/images.rb +21 -20
- data/lib/vagrant-profitbricks/command/locations.rb +34 -0
- data/lib/vagrant-profitbricks/command/root.rb +28 -23
- data/lib/vagrant-profitbricks/command/servers.rb +7 -4
- data/lib/vagrant-profitbricks/command/snapshots.rb +34 -0
- data/lib/vagrant-profitbricks/command/utils.rb +27 -0
- data/lib/vagrant-profitbricks/config.rb +44 -39
- data/lib/vagrant-profitbricks/errors.rb +14 -5
- data/lib/vagrant-profitbricks/plugin.rb +13 -11
- data/lib/vagrant-profitbricks/provider.rb +8 -6
- data/lib/vagrant-profitbricks/version.rb +3 -1
- data/locales/en.yml +28 -7
- data/spec/spec_helper.rb +4 -2
- data/spec/vagrant-profitbricks/config_spec.rb +65 -96
- data/vagrant-profitbricks.gemspec +17 -14
- metadata +42 -47
- data/Appraisals +0 -35
- data/CHANGELOG.md +0 -3
- data/RELEASE.md +0 -15
- data/bootstrap.cmd +0 -16
- data/features/provision.feature +0 -36
- data/features/steps/sdk_steps.rb +0 -13
- data/features/steps/server_steps.rb +0 -25
- data/features/support/env.rb +0 -35
- data/features/support/fog_mock.rb +0 -17
- data/features/vagrant-profitbricks.feature +0 -66
- data/lib/vagrant-profitbricks/action/create_image.rb +0 -53
- data/lib/vagrant-profitbricks/action/list_keypairs.rb +0 -20
- data/lib/vagrant-profitbricks/action/list_networks.rb +0 -20
- data/lib/vagrant-profitbricks/action/list_servers.rb +0 -21
- data/lib/vagrant-profitbricks/command/create_image.rb +0 -21
- data/lib/vagrant-profitbricks/command/keypairs.rb +0 -21
- data/lib/vagrant-profitbricks/command/list_images.rb +0 -21
- data/lib/vagrant-profitbricks/command/networks.rb +0 -21
- data/spec/vagrant-profitbricks/actions/list_flavors_spec.rb +0 -48
- data/spec/vagrant-profitbricks/actions/list_images_spec.rb +0 -48
@@ -1,25 +1,28 @@
|
|
1
|
-
|
1
|
+
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
lib = File.expand_path('../lib', __FILE__)
|
3
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
6
|
require 'vagrant-profitbricks/version'
|
5
7
|
|
6
8
|
Gem::Specification.new do |gem|
|
7
|
-
gem.name =
|
9
|
+
gem.name = 'vagrant-profitbricks'
|
8
10
|
gem.version = VagrantPlugins::ProfitBricks::VERSION
|
9
|
-
gem.authors = [
|
10
|
-
gem.email = [
|
11
|
-
gem.description =
|
12
|
-
gem.summary =
|
13
|
-
gem.homepage =
|
11
|
+
gem.authors = ['Jasmin Gacic']
|
12
|
+
gem.email = ['jasmin@stackpointcloud.com']
|
13
|
+
gem.description = 'Enables Vagrant to manage machines in a ProfitBricks Virtual Data Center.'
|
14
|
+
gem.summary = 'Enables Vagrant to manage machines in a ProfitBricks Virtual Data Center.'
|
15
|
+
gem.homepage = 'https://devops.proftibricks.com'
|
14
16
|
|
15
|
-
gem.add_runtime_dependency
|
17
|
+
gem.add_runtime_dependency 'fog-profitbricks', '~> 4.0'
|
18
|
+
gem.add_runtime_dependency 'terminal-table', '> 1.7.2'
|
16
19
|
|
17
|
-
gem.add_development_dependency
|
18
|
-
gem.add_development_dependency
|
19
|
-
gem.add_development_dependency
|
20
|
+
gem.add_development_dependency 'aruba', '~> 0.5.4'
|
21
|
+
gem.add_development_dependency 'rake'
|
22
|
+
gem.add_development_dependency 'rspec', '~> 2.14.0'
|
20
23
|
|
21
|
-
gem.files = `git ls-files`.split(
|
22
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
24
|
+
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
25
|
+
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
23
26
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
24
|
-
gem.require_paths = [
|
27
|
+
gem.require_paths = ['lib']
|
25
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-profitbricks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Jasmin Gacic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-profitbricks
|
@@ -16,107 +16,112 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: terminal-table
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '
|
31
|
+
- - '>'
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
34
|
-
type: :
|
33
|
+
version: 1.7.2
|
34
|
+
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - '
|
38
|
+
- - '>'
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.7.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: aruba
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.5.4
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.5.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - ~>
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
75
|
+
version: 2.14.0
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - ~>
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
82
|
+
version: 2.14.0
|
69
83
|
description: Enables Vagrant to manage machines in a ProfitBricks Virtual Data Center.
|
70
84
|
email:
|
71
|
-
-
|
85
|
+
- jasmin@stackpointcloud.com
|
72
86
|
executables: []
|
73
87
|
extensions: []
|
74
88
|
extra_rdoc_files: []
|
75
89
|
files:
|
76
90
|
- .gitignore
|
77
|
-
- Appraisals
|
78
|
-
- CHANGELOG.md
|
79
91
|
- Gemfile
|
80
92
|
- LICENSE
|
81
93
|
- README.md
|
82
|
-
- RELEASE.md
|
83
94
|
- Rakefile
|
84
95
|
- Vagrantfile
|
85
|
-
- bootstrap.cmd
|
86
96
|
- dummy.box
|
87
97
|
- example_box/README.md
|
98
|
+
- example_box/Vagrantfile
|
88
99
|
- example_box/metadata.json
|
89
|
-
-
|
90
|
-
- features/steps/sdk_steps.rb
|
91
|
-
- features/steps/server_steps.rb
|
92
|
-
- features/support/env.rb
|
93
|
-
- features/support/fog_mock.rb
|
94
|
-
- features/vagrant-profitbricks.feature
|
100
|
+
- example_box/profitbricks.box
|
95
101
|
- lib/vagrant-profitbricks.rb
|
96
102
|
- lib/vagrant-profitbricks/action.rb
|
97
103
|
- lib/vagrant-profitbricks/action/connect_profitbricks.rb
|
98
|
-
- lib/vagrant-profitbricks/action/create_image.rb
|
99
104
|
- lib/vagrant-profitbricks/action/create_server.rb
|
100
105
|
- lib/vagrant-profitbricks/action/delete_server.rb
|
101
106
|
- lib/vagrant-profitbricks/action/is_created.rb
|
102
107
|
- lib/vagrant-profitbricks/action/list_flavors.rb
|
103
108
|
- lib/vagrant-profitbricks/action/list_images.rb
|
104
|
-
- lib/vagrant-profitbricks/action/list_keypairs.rb
|
105
|
-
- lib/vagrant-profitbricks/action/list_networks.rb
|
106
|
-
- lib/vagrant-profitbricks/action/list_servers.rb
|
107
109
|
- lib/vagrant-profitbricks/action/message_already_created.rb
|
108
110
|
- lib/vagrant-profitbricks/action/message_not_created.rb
|
109
111
|
- lib/vagrant-profitbricks/action/read_ssh_info.rb
|
110
112
|
- lib/vagrant-profitbricks/action/read_state.rb
|
113
|
+
- lib/vagrant-profitbricks/action/reboot_server.rb
|
111
114
|
- lib/vagrant-profitbricks/action/run_init_script.rb
|
112
|
-
- lib/vagrant-profitbricks/
|
115
|
+
- lib/vagrant-profitbricks/action/start_server.rb
|
116
|
+
- lib/vagrant-profitbricks/action/stop_server.rb
|
117
|
+
- lib/vagrant-profitbricks/command/datacenters.rb
|
113
118
|
- lib/vagrant-profitbricks/command/flavors.rb
|
114
119
|
- lib/vagrant-profitbricks/command/images.rb
|
115
|
-
- lib/vagrant-profitbricks/command/
|
116
|
-
- lib/vagrant-profitbricks/command/list_images.rb
|
117
|
-
- lib/vagrant-profitbricks/command/networks.rb
|
120
|
+
- lib/vagrant-profitbricks/command/locations.rb
|
118
121
|
- lib/vagrant-profitbricks/command/root.rb
|
119
122
|
- lib/vagrant-profitbricks/command/servers.rb
|
123
|
+
- lib/vagrant-profitbricks/command/snapshots.rb
|
124
|
+
- lib/vagrant-profitbricks/command/utils.rb
|
120
125
|
- lib/vagrant-profitbricks/config.rb
|
121
126
|
- lib/vagrant-profitbricks/errors.rb
|
122
127
|
- lib/vagrant-profitbricks/plugin.rb
|
@@ -124,8 +129,6 @@ files:
|
|
124
129
|
- lib/vagrant-profitbricks/version.rb
|
125
130
|
- locales/en.yml
|
126
131
|
- spec/spec_helper.rb
|
127
|
-
- spec/vagrant-profitbricks/actions/list_flavors_spec.rb
|
128
|
-
- spec/vagrant-profitbricks/actions/list_images_spec.rb
|
129
132
|
- spec/vagrant-profitbricks/config_spec.rb
|
130
133
|
- vagrant-profitbricks.gemspec
|
131
134
|
homepage: https://devops.proftibricks.com
|
@@ -147,18 +150,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
150
|
version: '0'
|
148
151
|
requirements: []
|
149
152
|
rubyforge_project:
|
150
|
-
rubygems_version: 2.0.14
|
153
|
+
rubygems_version: 2.0.14.1
|
151
154
|
signing_key:
|
152
155
|
specification_version: 4
|
153
156
|
summary: Enables Vagrant to manage machines in a ProfitBricks Virtual Data Center.
|
154
157
|
test_files:
|
155
|
-
- features/provision.feature
|
156
|
-
- features/steps/sdk_steps.rb
|
157
|
-
- features/steps/server_steps.rb
|
158
|
-
- features/support/env.rb
|
159
|
-
- features/support/fog_mock.rb
|
160
|
-
- features/vagrant-profitbricks.feature
|
161
158
|
- spec/spec_helper.rb
|
162
|
-
- spec/vagrant-profitbricks/actions/list_flavors_spec.rb
|
163
|
-
- spec/vagrant-profitbricks/actions/list_images_spec.rb
|
164
159
|
- spec/vagrant-profitbricks/config_spec.rb
|
data/Appraisals
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# Note: You may need to use bundler 1.5.2 to run `appraisal install`
|
2
|
-
appraise "vagrant-1.7" do
|
3
|
-
group :plugins do
|
4
|
-
gem 'bundler', '>= 1.5.2', '< 1.8.0'
|
5
|
-
gem "vagrant", :git => 'https://github.com/mitchellh/vagrant', :tag => 'v1.7.1'
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
appraise "vagrant-1.6" do
|
10
|
-
gem 'bundler', '>= 1.5.2', '< 1.7.0'
|
11
|
-
group :plugins do
|
12
|
-
gem "vagrant", :git => 'https://github.com/mitchellh/vagrant', :tag => 'v1.6.5'
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
appraise "vagrant-1.5" do
|
17
|
-
gem 'bundler', '= 1.5.2'
|
18
|
-
group :plugins do
|
19
|
-
gem "vagrant", :git => 'https://github.com/mitchellh/vagrant', :tag => 'v1.5.4'
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
# Oldest supported
|
24
|
-
appraise "vagrant-1.5.0" do
|
25
|
-
gem 'bundler', '= 1.5.2'
|
26
|
-
group :plugins do
|
27
|
-
gem "vagrant", :git => 'https://github.com/mitchellh/vagrant', :tag => 'v1.5.4'
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
appraise "windows-wip" do
|
32
|
-
group :plugins do
|
33
|
-
gem "vagrant", :git => 'https://github.com/maxlinc/vagrant', :branch => 'winrm-1.3'
|
34
|
-
end
|
35
|
-
end
|
data/CHANGELOG.md
DELETED
data/RELEASE.md
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# Release process
|
2
|
-
|
3
|
-
This is the current release process for 'vagrant-profitbricks'.
|
4
|
-
|
5
|
-
## Prepare the release
|
6
|
-
|
7
|
-
* Update the version in "lib/vagrant-profitbricks/version.rb"
|
8
|
-
* Update the version in CHANGELOG.md
|
9
|
-
* Use "rake release". This will make sure to tag that commit and push it to RubyGems.
|
10
|
-
* Create new [github release](https://github.com/profitbricks/vagrant-profitbricks/releases)
|
11
|
-
* Update the version again in both files to a dev version for working again.
|
12
|
-
|
13
|
-
The CHANGELOG.md should be maintained in a similar format to Vagrant:
|
14
|
-
|
15
|
-
https://github.com/mitchellh/vagrant/blob/master/CHANGELOG.md
|
data/bootstrap.cmd
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
Function SetupWinRM
|
2
|
-
{
|
3
|
-
Param(
|
4
|
-
[String]$hostname,
|
5
|
-
[String]$thumbprint
|
6
|
-
)
|
7
|
-
netsh advfirewall firewall set rule group="remote administration" new enable=yes
|
8
|
-
netsh advfirewall firewall add rule name="WinRM HTTP" dir=in action=allow protocol=TCP localport=5985
|
9
|
-
netsh advfirewall firewall add rule name="WinRM HTTPS" dir=in action=allow protocol=TCP localport=5986
|
10
|
-
winrm create winrm/config/Listener?Address=*+Transport=HTTPS "@{Hostname=`"${hostname}`"; CertificateThumbprint=`"${thumbprint}`"}"
|
11
|
-
}
|
12
|
-
|
13
|
-
$hostname = $env:COMPUTERNAME
|
14
|
-
$cert = New-SelfSignedCertificate -CertStoreLocation cert:\LocalMachine\My -DnsName $hostname
|
15
|
-
$thumbprint = $cert.Thumbprint
|
16
|
-
SetupWinRM -hostname $hostname -thumbprint $thumbprint
|
data/features/provision.feature
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
@announce
|
2
|
-
@vagrant-profitbricks
|
3
|
-
Feature: vagrant-profitbricks fog tests
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given I have ProfitBricks credentials available
|
7
|
-
And I have a "fog_mock.rb" file
|
8
|
-
|
9
|
-
Scenario: Create a single server (with provisioning)
|
10
|
-
Given a file named "Vagrantfile" with:
|
11
|
-
"""
|
12
|
-
Vagrant.configure("2") do |config|
|
13
|
-
Vagrant.require_plugin "vagrant-profitbricks"
|
14
|
-
|
15
|
-
config.vm.box = "dummy"
|
16
|
-
config.ssh.private_key_path = "~/.ssh/id_rsa"
|
17
|
-
|
18
|
-
|
19
|
-
config.vm.provider :profitbricks do |rs|
|
20
|
-
rs.server_name = 'vagrant-provisioned-server'
|
21
|
-
rs.username = ENV['PB_USERNAME']
|
22
|
-
rs.password = ENV['PB_PASSWORD']
|
23
|
-
rs.flavor = "Micro"
|
24
|
-
rs.image = /Ubuntu/
|
25
|
-
rs.admin_password = 'Vagrant123'
|
26
|
-
rs.data_center_id = /My/ #'d7c69d5e-59e2-4133-a982-788fe4bb7599'
|
27
|
-
rs.profitbricks_volume_size = 8
|
28
|
-
end
|
29
|
-
|
30
|
-
config.vm.provision :shell, :inline => "echo Hello, World"
|
31
|
-
end
|
32
|
-
"""
|
33
|
-
When I successfully run `bundle exec vagrant up --provider profitbricks`
|
34
|
-
# I want to capture the ID like I do in tests for other tools, but Vagrant doesn't print it!
|
35
|
-
# And I get the server from "Instance ID:"
|
36
|
-
Then the server "vagrant-provisioned-server" should be active
|
data/features/steps/sdk_steps.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Given(/^I have ProfitBricks credentials available$/) do
|
2
|
-
fail unless ENV['PB_USERNAME'] && ENV['PB_API_PASSWORD']
|
3
|
-
end
|
4
|
-
|
5
|
-
Given(/^I have a "fog_mock.rb" file$/) do
|
6
|
-
script = File.open("features/support/fog_mock.rb").read
|
7
|
-
steps %Q{
|
8
|
-
Given a file named "fog_mock.rb" with:
|
9
|
-
"""
|
10
|
-
#{script}
|
11
|
-
"""
|
12
|
-
}
|
13
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
When(/^I get the server from "(.*?)"$/) do |label|
|
2
|
-
@server_id = all_output.match(/#{label}\s([\w-]*)/)[1]
|
3
|
-
puts "Server: #{@server_id}"
|
4
|
-
end
|
5
|
-
|
6
|
-
When(/^I load the server$/) do
|
7
|
-
@server_id = all_output.strip.lines.to_a.last
|
8
|
-
puts "Server: #{@server_id}"
|
9
|
-
end
|
10
|
-
|
11
|
-
Then(/^the server should be active$/) do
|
12
|
-
unless Fog.mock? # unfortunately we can't assert this with Fog.mock!, since mocked objects do not persist from the subprocess
|
13
|
-
assert_active @server_id
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
Then(/^the server "(.+)" should be active$/) do |server_name|
|
18
|
-
server = @compute.servers.all.find{|s| s.name == server_name}
|
19
|
-
assert_active server.id
|
20
|
-
end
|
21
|
-
|
22
|
-
def assert_active server_id
|
23
|
-
server = @compute.servers.get server_id
|
24
|
-
server.state.should == 'available'
|
25
|
-
end
|
data/features/support/env.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'fog'
|
2
|
-
require 'aruba/cucumber'
|
3
|
-
|
4
|
-
Fog.mock! if ENV['PB_MOCK'] == 'true'
|
5
|
-
|
6
|
-
Before do | scenario |
|
7
|
-
@aruba_timeout_seconds = 600
|
8
|
-
@scenario = File.basename(scenario.file)
|
9
|
-
ENV['CASSETTE'] = @scenario
|
10
|
-
|
11
|
-
# proxy_options = {
|
12
|
-
# :connection_options => {
|
13
|
-
# :proxy => ENV['https_proxy'],
|
14
|
-
# :ssl_verify_peer => false
|
15
|
-
# }
|
16
|
-
# }
|
17
|
-
|
18
|
-
connect_options = {
|
19
|
-
:provider => 'profitbricks',
|
20
|
-
:profitbricks_username => ENV['PB_USERNAME'],
|
21
|
-
:profitbricks_password => ENV['PB_API_PASSWORD'],
|
22
|
-
}
|
23
|
-
#connect_options.merge!(proxy_options) unless ENV['https_proxy'].nil?
|
24
|
-
@compute = Fog::Compute.new(connect_options)
|
25
|
-
end
|
26
|
-
|
27
|
-
# Around do | scenario, block |
|
28
|
-
# Bundler.with_clean_env do
|
29
|
-
# block.call
|
30
|
-
# end
|
31
|
-
# end
|
32
|
-
|
33
|
-
After('@creates_server') do
|
34
|
-
@compute.servers.delete @server_id
|
35
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'fog'
|
2
|
-
if ENV['PB_MOCK'] == 'true'
|
3
|
-
Fog.mock!
|
4
|
-
# Fog::ProfitBricks::MockData.configure do |c|
|
5
|
-
# c[:image_name_generator] = Proc.new { "Ubuntu" }
|
6
|
-
# c[:ipv4_generator] = Proc.new { "10.11.12.2"}
|
7
|
-
# end
|
8
|
-
connect_options = {
|
9
|
-
:provider => 'profitbricks',
|
10
|
-
:profitbricks_username => ENV['PB_USERNAME'],
|
11
|
-
:profitbricks_password => ENV['PB_API_PASSWORD']
|
12
|
-
}
|
13
|
-
connect_options.merge!(proxy_options) unless ENV['https_proxy'].nil?
|
14
|
-
compute = Fog::Compute.new(connect_options)
|
15
|
-
# Force creation of Ubuntu image so it will show up in compute.images.list
|
16
|
-
compute.images.get(0)
|
17
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
@announce
|
2
|
-
@vagrant-profitbricks
|
3
|
-
Feature: vagrant-profitbricks fog tests
|
4
|
-
As a Fog developer
|
5
|
-
I want to smoke (or "fog") test vagrant-profitbricks.
|
6
|
-
So I am confident my upstream changes did not create downstream problems.
|
7
|
-
|
8
|
-
Background:
|
9
|
-
Given I have ProfitBricks credentials available
|
10
|
-
And I have a "fog_mock.rb" file
|
11
|
-
|
12
|
-
Scenario: Create a single server
|
13
|
-
Given a file named "Vagrantfile" with:
|
14
|
-
"""
|
15
|
-
# Testing options
|
16
|
-
require File.expand_path '../fog_mock', __FILE__
|
17
|
-
|
18
|
-
Vagrant.configure("2") do |config|
|
19
|
-
# dev/test method of loading plugin, normally would be 'vagrant plugin install vagrant-profitbricks'
|
20
|
-
Vagrant.require_plugin "vagrant-profitbricks"
|
21
|
-
|
22
|
-
config.vm.box = "dummy"
|
23
|
-
config.ssh.username = "vagrant" if Fog.mock?
|
24
|
-
config.ssh.private_key_path = "~/.ssh/id_rsa" unless Fog.mock?
|
25
|
-
|
26
|
-
config.vm.provider :profitbricks do |rs|
|
27
|
-
rs.server_name = 'vagrant-single-server'
|
28
|
-
rs.username = ENV['PB_USERNAME']
|
29
|
-
rs.password = ENV['PB_PASSWORD']
|
30
|
-
rs.flavor = /1 GB Performance/
|
31
|
-
rs.image = /Ubuntu/
|
32
|
-
end
|
33
|
-
end
|
34
|
-
"""
|
35
|
-
When I successfully run `bundle exec vagrant up --provider profitbricks`
|
36
|
-
# I want to capture the ID like I do in tests for other tools, but Vagrant doesn't print it!
|
37
|
-
# And I get the server from "Instance ID:"
|
38
|
-
Then the server "vagrant-single-server" should be active
|
39
|
-
|
40
|
-
Scenario: Create a single server (profitbricks_compute_url)
|
41
|
-
Given a file named "Vagrantfile" with:
|
42
|
-
"""
|
43
|
-
# Testing options
|
44
|
-
require File.expand_path '../fog_mock', __FILE__
|
45
|
-
|
46
|
-
Vagrant.configure("2") do |config|
|
47
|
-
# dev/test method of loading plugin, normally would be 'vagrant plugin install vagrant-profitbricks'
|
48
|
-
Vagrant.require_plugin "vagrant-profitbricks"
|
49
|
-
|
50
|
-
config.vm.box = "dummy"
|
51
|
-
config.ssh.username = "vagrant" if Fog.mock?
|
52
|
-
config.ssh.private_key_path = "~/.ssh/id_rsa" unless Fog.mock?
|
53
|
-
|
54
|
-
config.vm.provider :profitbricks do |rs|
|
55
|
-
rs.server_name = 'vagrant-single-server'
|
56
|
-
rs.username = ENV['PB_USERNAME']
|
57
|
-
rs.password = ENV['PB_PASSWORD']
|
58
|
-
rs.flavor = /1 GB Performance/
|
59
|
-
rs.image = /Ubuntu/
|
60
|
-
end
|
61
|
-
end
|
62
|
-
"""
|
63
|
-
When I successfully run `bundle exec vagrant up --provider profitbricks`
|
64
|
-
# I want to capture the ID like I do in tests for other tools, but Vagrant doesn't print it!
|
65
|
-
# And I get the server from "Instance ID:"
|
66
|
-
Then the server "vagrant-single-server" should be active
|