vcloud-launcher 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dd33021e4789fe353a36dd716c660f8bfa7eddd8
4
+ data.tar.gz: ee334e1e7ab891401bf610b31cf7ef7bb7f6922f
5
+ SHA512:
6
+ metadata.gz: d47d2e4213fc5030a02e26c00de8e50a63bb2dc7f6fb35014c6381f2e9442dd6b20f128fd7d3772c2856c83c10c1fda8813bf67ac7d5fbc21c03d10871906bc0
7
+ data.tar.gz: 50cc8a9431b5d838f7c10752431f89331a4b9abbfbf36df4e269cb18db145e16df56941c434f3b260fc38d262076be1aa7f3149bfb8e26def7371627b89d117a
data/.travis.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  language: ruby
3
3
  rvm:
4
- - 1.9.3
5
4
  - 2.0.0
6
5
  - 2.1.2
7
6
  notifications:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 2.0.0 (2015-10-20)
2
+
3
+ - Remove support for Ruby 1.9.3, which is now end-of-life.
4
+ - Relax dependency on vCloud Core to make it easier to install
5
+ alongside other vCloud gems.
6
+
7
+ ## 1.2.0 (2015-08-28)
8
+
9
+ - Add a `--vapp-name` option to launch a single machine
10
+
1
11
  ## 1.1.0 (2015-07-09)
2
12
 
3
13
  - Add optional MAC address to the schema for a VM
data/jenkins.sh CHANGED
@@ -2,4 +2,6 @@
2
2
  set -e
3
3
 
4
4
  ./jenkins_tests.sh
5
+
6
+ source ./rbenv_version.sh
5
7
  bundle exec rake publish_gem
data/jenkins_tests.sh CHANGED
@@ -18,6 +18,8 @@ ${FOG_CREDENTIAL}:
18
18
  vcloud_director_password: ''
19
19
  EOF
20
20
 
21
+ source ./rbenv_version.sh
22
+
21
23
  git clean -ffdx
22
24
 
23
25
  bundle install --path "${HOME}/bundles/${JOB_NAME}"
@@ -8,6 +8,7 @@ module Vcloud
8
8
  @config_file = nil
9
9
  @usage_text = nil
10
10
  @options = {
11
+ "vapp-name" => false,
11
12
  "dont-power-on" => false,
12
13
  "continue-on-error" => false,
13
14
  "quiet" => false,
@@ -57,6 +58,10 @@ Example configuration files can be found in:
57
58
  opts.separator ""
58
59
  opts.separator "Options:"
59
60
 
61
+ opts.on('-n VAPP_NAME', '--vapp-name VAPP_NAME', 'Name of a single vApp to launch') do |vapp_name|
62
+ @options['vapp-name'] = vapp_name
63
+ end
64
+
60
65
  opts.on("-x", "--dont-power-on", "Do not power on vApps (default is to power on)") do
61
66
  @options["dont-power-on"] = true
62
67
  end
@@ -14,6 +14,8 @@ module Vcloud
14
14
  set_logging_level
15
15
  @config = config_loader.load_config(config_file, Vcloud::Launcher::Schema::LAUNCHER_VAPPS)
16
16
 
17
+ ignore_unspecified_machines
18
+
17
19
  validate_config
18
20
  end
19
21
 
@@ -75,6 +77,14 @@ module Vcloud
75
77
  end
76
78
  end
77
79
 
80
+ def ignore_unspecified_machines
81
+ if @cli_options["vapp-name"]
82
+ @config[:vapps].delete_if do |vapp|
83
+ vapp[:name] != @cli_options["vapp-name"]
84
+ end
85
+ end
86
+ end
87
+
78
88
  def validate_config
79
89
  @config[:vapps].each do |vapp_config|
80
90
  validate_vapp_config(vapp_config)
@@ -1,5 +1,5 @@
1
1
  module Vcloud
2
2
  module Launcher
3
- VERSION = '1.1.0'
3
+ VERSION = '2.0.0'
4
4
  end
5
5
  end
data/rbenv_version.sh ADDED
@@ -0,0 +1 @@
1
+ export RBENV_VERSION="2.0.0"
@@ -48,6 +48,7 @@ describe Vcloud::Launcher::Cli do
48
48
  let(:args) { [ config_file ] }
49
49
  let(:cli_options) {
50
50
  {
51
+ "vapp-name" => false,
51
52
  "dont-power-on" => false,
52
53
  "continue-on-error" => false,
53
54
  "quiet" => false,
@@ -63,6 +64,7 @@ describe Vcloud::Launcher::Cli do
63
64
  let(:args) { [ config_file, "--dont-power-on" ] }
64
65
  let(:cli_options) {
65
66
  {
67
+ "vapp-name" => false,
66
68
  "dont-power-on" => true,
67
69
  "continue-on-error" => false,
68
70
  "quiet" => false,
@@ -78,6 +80,7 @@ describe Vcloud::Launcher::Cli do
78
80
  let(:args) { [ config_file, "--continue-on-error" ] }
79
81
  let(:cli_options) {
80
82
  {
83
+ "vapp-name" => false,
81
84
  "dont-power-on" => false,
82
85
  "continue-on-error" => true,
83
86
  "quiet" => false,
@@ -93,6 +96,7 @@ describe Vcloud::Launcher::Cli do
93
96
  let(:args) { [ config_file, "--quiet" ] }
94
97
  let(:cli_options) {
95
98
  {
99
+ "vapp-name" => false,
96
100
  "dont-power-on" => false,
97
101
  "continue-on-error" => false,
98
102
  "quiet" => true,
@@ -108,6 +112,7 @@ describe Vcloud::Launcher::Cli do
108
112
  let(:args) { [ config_file, "--verbose" ] }
109
113
  let(:cli_options) {
110
114
  {
115
+ "vapp-name" => false,
111
116
  "dont-power-on" => false,
112
117
  "continue-on-error" => false,
113
118
  "quiet" => false,
@@ -123,6 +128,7 @@ describe Vcloud::Launcher::Cli do
123
128
  let(:args) { [ config_file, "--continue-on-error", "--verbose" ] }
124
129
  let(:cli_options) {
125
130
  {
131
+ "vapp-name" => false,
126
132
  "dont-power-on" => false,
127
133
  "continue-on-error" => true,
128
134
  "quiet" => false,
@@ -138,6 +144,7 @@ describe Vcloud::Launcher::Cli do
138
144
  let(:args) { [ config_file, "--post-launch-cmd", "GIRAFFE" ] }
139
145
  let(:cli_options) {
140
146
  {
147
+ "vapp-name" => false,
141
148
  "dont-power-on" => false,
142
149
  "continue-on-error" => false,
143
150
  "quiet" => false,
@@ -153,6 +160,7 @@ describe Vcloud::Launcher::Cli do
153
160
  let(:args) { [ config_file, "--post-launch-cmd", "GIRAFFE LION" ] }
154
161
  let(:cli_options) {
155
162
  {
163
+ "vapp-name" => false,
156
164
  "dont-power-on" => false,
157
165
  "continue-on-error" => false,
158
166
  "quiet" => false,
@@ -51,6 +51,11 @@ describe Vcloud::Launcher::Launch do
51
51
  subject.new(config_file)
52
52
  end
53
53
 
54
+ it 'does not process non-matching machines if a single one is specified' do
55
+ subject.any_instance.should_receive(:ignore_unspecified_machines)
56
+ subject.new(config_file)
57
+ end
58
+
54
59
  it 'validates the configuration' do
55
60
  subject.any_instance.should_receive(:validate_config)
56
61
  subject.new(config_file)
@@ -139,6 +144,30 @@ describe Vcloud::Launcher::Launch do
139
144
  end
140
145
  end
141
146
 
147
+ describe '#ignore_unspecified_machines' do
148
+ subject { Vcloud::Launcher::Launch }
149
+
150
+ describe 'when the vApp name option is not specified' do
151
+ let(:cli_options) { {} }
152
+
153
+ it 'processes all machines' do
154
+ launch = subject.new(config_file, cli_options)
155
+ expect(launch.config[:vapps].length).to eq(3)
156
+ end
157
+ end
158
+
159
+ describe 'when a vApp name is specified as an option' do
160
+ let(:cli_options) { {"vapp-name" => "successful app 1"} }
161
+
162
+ it 'only processes the specified vApp' do
163
+ launch = subject.new(config_file, cli_options)
164
+ expect(launch.config[:vapps].length).to eq(1)
165
+ expect(launch.config[:vapps][0][:name]).to eq('successful app 1')
166
+ end
167
+ end
168
+
169
+ end
170
+
142
171
  describe "configuration validation" do
143
172
  let(:config_file) { 'foo' }
144
173
 
@@ -18,9 +18,9 @@ Gem::Specification.new do |s|
18
18
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
19
19
  s.require_paths = ['lib']
20
20
 
21
- s.required_ruby_version = '>= 1.9.3'
21
+ s.required_ruby_version = '>= 2.0.0'
22
22
 
23
- s.add_runtime_dependency 'vcloud-core', '~> 1.1.0'
23
+ s.add_runtime_dependency 'vcloud-core', '~> 1.1'
24
24
  s.add_development_dependency 'gem_publisher', '1.2.0'
25
25
  s.add_development_dependency 'pry'
26
26
  s.add_development_dependency 'rake'
metadata CHANGED
@@ -1,36 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcloud-launcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
5
- prerelease:
4
+ version: 2.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Anna Shipman
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2015-07-09 00:00:00.000000000 Z
11
+ date: 2015-10-20 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: vcloud-core
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: 1.1.0
19
+ version: '1.1'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
29
- version: 1.1.0
26
+ version: '1.1'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: gem_publisher
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - '='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - '='
44
39
  - !ruby/object:Gem::Version
@@ -46,39 +41,34 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: pry
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rake
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rspec
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rubocop
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
@@ -110,7 +97,6 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: simplecov
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
101
  - - ~>
116
102
  - !ruby/object:Gem::Version
@@ -118,7 +104,6 @@ dependencies:
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
108
  - - ~>
124
109
  - !ruby/object:Gem::Version
@@ -126,7 +111,6 @@ dependencies:
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: vcloud-tools-tester
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
115
  - - ~>
132
116
  - !ruby/object:Gem::Version
@@ -134,7 +118,6 @@ dependencies:
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
122
  - - ~>
140
123
  - !ruby/object:Gem::Version
@@ -174,6 +157,7 @@ files:
174
157
  - lib/vcloud/launcher/vapp_orchestrator.rb
175
158
  - lib/vcloud/launcher/version.rb
176
159
  - lib/vcloud/launcher/vm_orchestrator.rb
160
+ - rbenv_version.sh
177
161
  - scripts/basic.erb
178
162
  - spec/erb_helper.rb
179
163
  - spec/integration/launcher/data/basic_preamble_test.erb
@@ -198,30 +182,26 @@ files:
198
182
  homepage: https://github.com/gds-operations/vcloud-launcher
199
183
  licenses:
200
184
  - MIT
185
+ metadata: {}
201
186
  post_install_message:
202
187
  rdoc_options: []
203
188
  require_paths:
204
189
  - lib
205
190
  required_ruby_version: !ruby/object:Gem::Requirement
206
- none: false
207
191
  requirements:
208
- - - ! '>='
192
+ - - '>='
209
193
  - !ruby/object:Gem::Version
210
- version: 1.9.3
194
+ version: 2.0.0
211
195
  required_rubygems_version: !ruby/object:Gem::Requirement
212
- none: false
213
196
  requirements:
214
- - - ! '>='
197
+ - - '>='
215
198
  - !ruby/object:Gem::Version
216
199
  version: '0'
217
- segments:
218
- - 0
219
- hash: 3247835755938666789
220
200
  requirements: []
221
201
  rubyforge_project:
222
- rubygems_version: 1.8.23
202
+ rubygems_version: 2.1.11
223
203
  signing_key:
224
- specification_version: 3
204
+ specification_version: 4
225
205
  summary: Tool to launch and configure vCloud vApps
226
206
  test_files:
227
207
  - spec/erb_helper.rb