vagrant-service-manager 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.config/cucumber.yml +2 -1
- data/.github/ISSUE_TEMPLATE.MD +39 -0
- data/CHANGELOG.md +9 -0
- data/README.adoc +41 -9
- data/features/adb-openshift.feature +81 -0
- data/features/{openshift.feature → cdk-openshift.feature} +3 -3
- data/features/support/env.rb +1 -2
- data/lib/vagrant-service-manager/binary_handlers/adb_openshift_binary_handler.rb +2 -2
- data/lib/vagrant-service-manager/binary_handlers/binary_handler.rb +4 -2
- data/lib/vagrant-service-manager/version.rb +1 -1
- data/locales/en.yml +4 -0
- data/test/vagrant-service-manager/binary_handlers/adb_docker_binary_handler_test.rb +5 -0
- data/test/vagrant-service-manager/binary_handlers/adb_openshift_binary_handler_test.rb +5 -0
- metadata +19 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db7d21ac315f5396203911de486a543e43c3afa7
|
4
|
+
data.tar.gz: 63bfe53f87818feb3d5419bebe116b1ece15dd53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d064533950594f7784f42d60d040b285310a9871f57b25014ee5233b995d2274d36847e3a241cee0daa18f91efbd24e5353a94c1d2007168719b109637197b77
|
7
|
+
data.tar.gz: 37a7972b7aff6ea2cfa9f28e5c15d29a178c6d4daea897c12c47178cc4f9745f45e62bf4105d863307c484bc5999ff8bf5c54bea2f2cc48342ec5183478e6925
|
data/.config/cucumber.yml
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
<!--
|
2
|
+
If you are reporting a new issue, make sure that we do not have any duplicates
|
3
|
+
already open. You can ensure this by searching the issue list for this
|
4
|
+
repository.
|
5
|
+
For more information about reporting issues, see
|
6
|
+
https://github.com/budhrg/vagrant-service-manager/blob/master/CONTRIBUTING.adoc#submitting-issues.
|
7
|
+
-->
|
8
|
+
|
9
|
+
**OS details:**
|
10
|
+
|
11
|
+
|
12
|
+
**Provider:**
|
13
|
+
VirtualBox and/or Libvirt and/or HyperV (for CDK only)
|
14
|
+
|
15
|
+
|
16
|
+
**Output of `vagrant -v`:**
|
17
|
+
```
|
18
|
+
(paste your output here)
|
19
|
+
```
|
20
|
+
|
21
|
+
**Output of `vagrant plugin list`:**
|
22
|
+
```
|
23
|
+
(paste your output here)
|
24
|
+
```
|
25
|
+
|
26
|
+
**Output of `vagrant service-manager box version`:**
|
27
|
+
```
|
28
|
+
(paste your output here)
|
29
|
+
```
|
30
|
+
|
31
|
+
**Steps to reproduce the issue:**
|
32
|
+
1.
|
33
|
+
2.
|
34
|
+
3.
|
35
|
+
|
36
|
+
**Describe the results you received:**
|
37
|
+
|
38
|
+
|
39
|
+
**Describe the results you expected:**
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v1.2.2 Aug 04, 2016
|
4
|
+
|
5
|
+
- Fix #365 undefined method `captures' for nil:NilClass @budhrg
|
6
|
+
- Fix #348 Handle 302 redirection in install-cli URL validation @budhrg
|
7
|
+
- Adding docs about using Cucumber tags @hferentschik
|
8
|
+
- Fix #357 Unable to download cli if user used latest tag or a alpha/beta tag @budhrg
|
9
|
+
- Fix #358 Adding reference to ADB installation documentation @hferentschik
|
10
|
+
- Fix #352 Create ISSUE_TEMPLATE.MD @budhrg
|
11
|
+
|
3
12
|
## v1.2.1 Jul 15, 2016
|
4
13
|
|
5
14
|
- Fix #343 Updated CHANGELOG for user name @budhrg
|
data/README.adoc
CHANGED
@@ -35,6 +35,9 @@ Vagrant plugin installation method:
|
|
35
35
|
$ vagrant plugin install vagrant-service-manager
|
36
36
|
------------------------------------------------
|
37
37
|
|
38
|
+
NOTE: To resolve any issues with the plugin installation and for more information on how to install Vagrant on various systems, refer to the
|
39
|
+
https://github.com/projectatomic/adb-atomic-developer-bundle/blob/master/docs/installing.rst[ADB installation instructions].
|
40
|
+
|
38
41
|
== Usage
|
39
42
|
|
40
43
|
=== Example execution of the plugin
|
@@ -213,9 +216,18 @@ acceptance tests. They can be run via:
|
|
213
216
|
$ bundle exec rake features
|
214
217
|
---------------------------
|
215
218
|
|
219
|
+
You can run a single feature specifying the path to the feature file
|
220
|
+
to run via the _FEATURE_ environment variable:
|
221
|
+
|
222
|
+
-----------------------------------------------------------------------
|
223
|
+
$ bundle exec rake features FEATURE=features/<feature-filename>.feature
|
224
|
+
-----------------------------------------------------------------------
|
225
|
+
|
216
226
|
NOTE: These Cucumber tests do not run on Windows, pending resolution of
|
217
227
|
https://github.com/projectatomic/vagrant-service-manager/issues/213[Issue #213].
|
218
228
|
|
229
|
+
==== Controlling virtualization provider and box type via _PROVIDER_ and _BOX_ environment variables
|
230
|
+
|
219
231
|
Per default, only the scenarios for ADB in combination with the
|
220
232
|
VirtualBox provider are run. However, you can also run the tests against CDK
|
221
233
|
and/or use the Libvirt provider using the environment variables _BOX_
|
@@ -232,23 +244,43 @@ $ bundle exec rake features BOX=cdk,adb
|
|
232
244
|
$ bundle exec rake features BOX=cdk,adb PROVIDER=libvirt,virtualbox
|
233
245
|
-----------------------------------------------------
|
234
246
|
|
247
|
+
==== Test boxes
|
248
|
+
|
235
249
|
The _features_ task will transparently download the required Vagrant
|
236
|
-
boxes and cache them in _.boxes_. The cache can be cleared
|
237
|
-
via the _clean_boxes_ task.
|
250
|
+
boxes and cache them in the _.boxes_ directory. The cache can be cleared
|
251
|
+
via the _clean_boxes_ task. For implementation details refer to the
|
252
|
+
https://github.com/projectatomic/vagrant-service-manager/blob/master/Rakefile[Rakefile].
|
238
253
|
|
239
254
|
Using the variable _NIGHTLY=true_ you can make sure that the
|
240
255
|
latest nightly build of the CDK is used (VPN access required).
|
241
|
-
Per default the latest public release of the CDK is used.
|
242
256
|
|
243
|
-
|
244
|
-
|
257
|
+
--------------------------------------------------
|
258
|
+
# Uses the latest nightly build of the CDK instead of the latest public release as per developer.redhat.com
|
259
|
+
$ bundle exec rake features BOX=cdk NIGHTLY=true
|
260
|
+
--------------------------------------------------
|
245
261
|
|
246
|
-
|
247
|
-
|
248
|
-
|
262
|
+
NOTE: Per default the latest public release of the CDK is used.
|
263
|
+
|
264
|
+
==== Cucumber tags
|
265
|
+
|
266
|
+
Some of the scenarios take a long time to run, so in order to keep the
|
267
|
+
turn-around time on the development machine acceptable, we also make
|
268
|
+
use of the _@ci-only_ https://github.com/cucumber/cucumber/wiki/Tags[tag].
|
269
|
+
|
270
|
+
Per default scenarios annotated with _@ci-only_ are only run on the
|
271
|
+
https://ci.centos.org/job/vagrant-service-manager[CI server]. Also, to run these tests locally,
|
272
|
+
you need to activate the _all_ profile:
|
273
|
+
|
274
|
+
--------------------------------------------------
|
275
|
+
bundle exec rake features CUCUMBER_OPTS='-p all'
|
276
|
+
--------------------------------------------------
|
277
|
+
|
278
|
+
For other defined profiles refer to Cucumber config file https://github.com/projectatomic/vagrant-service-manager/blob/master/.config/cucumber.yml[cucumber.yml].
|
279
|
+
|
280
|
+
==== Cucumber test reports
|
249
281
|
|
250
282
|
After test execution, the Cucumber test reports can be found under
|
251
|
-
_build/features_report.html_. They can
|
283
|
+
_build/features_report.html_. They can be opened via:
|
252
284
|
|
253
285
|
---------------------------------------
|
254
286
|
$ bundle exec rake features:open_report
|
@@ -0,0 +1,81 @@
|
|
1
|
+
Feature: Command output from various OpenShift related commands in ADB
|
2
|
+
service-manager should return the correct output from commands affecting OpenShift in ADB
|
3
|
+
|
4
|
+
@ci-only
|
5
|
+
Scenario Outline: Boot and execute commands
|
6
|
+
Given box is <box>
|
7
|
+
And provider is <provider>
|
8
|
+
And a file named "Vagrantfile" with:
|
9
|
+
"""
|
10
|
+
begin
|
11
|
+
require 'vagrant-libvirt'
|
12
|
+
rescue LoadError
|
13
|
+
# NOOP
|
14
|
+
end
|
15
|
+
|
16
|
+
Vagrant.configure('2') do |config|
|
17
|
+
config.vm.box = '<box>'
|
18
|
+
config.vm.box_url = 'file://../../.boxes/<box>-<provider>.box'
|
19
|
+
config.vm.network :private_network, ip: '<ip>'
|
20
|
+
config.vm.synced_folder '.', '/vagrant', disabled: true
|
21
|
+
config.servicemanager.services = 'docker, openshift'
|
22
|
+
|
23
|
+
config.servicemanager.openshift_image_tag = 'v1.2.1'
|
24
|
+
config.servicemanager.openshift_image_name = 'openshift/origin'
|
25
|
+
config.servicemanager.openshift_docker_registry = 'docker.io'
|
26
|
+
end
|
27
|
+
"""
|
28
|
+
|
29
|
+
When I successfully run `bundle exec vagrant up --provider <provider>`
|
30
|
+
# TODO, for some reason I can not use 'successfully' here. Seems the exit code is not 0 in this case!?
|
31
|
+
And I run `bundle exec vagrant service-manager env openshift`
|
32
|
+
Then stdout from "bundle exec vagrant service-manager env openshift" should be evaluable in a shell
|
33
|
+
And stdout from "bundle exec vagrant service-manager env openshift" should contain:
|
34
|
+
"""
|
35
|
+
# You can access the OpenShift console on: https://<ip>:8443/console
|
36
|
+
# To use OpenShift CLI, run: oc login https://<ip>:8443
|
37
|
+
export OPENSHIFT_URL=https://<ip>:8443
|
38
|
+
export OPENSHIFT_WEB_CONSOLE=https://<ip>:8443/console
|
39
|
+
export DOCKER_REGISTRY=hub.openshift.centos7-adb.<ip>.xip.io
|
40
|
+
|
41
|
+
# run following command to configure your shell:
|
42
|
+
# eval "$(vagrant service-manager env openshift)"
|
43
|
+
"""
|
44
|
+
|
45
|
+
When I successfully run `bundle exec vagrant service-manager env openshift --script-readable`
|
46
|
+
Then stdout from "bundle exec vagrant service-manager env openshift --script-readable" should be script readable
|
47
|
+
And stdout from "bundle exec vagrant service-manager env openshift --script-readable" should contain:
|
48
|
+
"""
|
49
|
+
OPENSHIFT_URL=https://<ip>:8443
|
50
|
+
OPENSHIFT_WEB_CONSOLE=https://<ip>:8443/console
|
51
|
+
DOCKER_REGISTRY=hub.openshift.centos7-adb.<ip>.xip.io
|
52
|
+
"""
|
53
|
+
|
54
|
+
When I successfully run `bundle exec vagrant service-manager env`
|
55
|
+
Then stdout from "bundle exec vagrant service-manager env" should contain "export DOCKER_HOST=tcp://<ip>:2376"
|
56
|
+
And stdout from "bundle exec vagrant service-manager env" should match /export DOCKER_CERT_PATH=.*\/.vagrant\/machines\/cdk\/virtualbox\/docker/
|
57
|
+
And stdout from "bundle exec vagrant service-manager env" should contain "export DOCKER_TLS_VERIFY=1"
|
58
|
+
And stdout from "bundle exec vagrant service-manager env" should match /export DOCKER_API_VERSION=1.2\d/
|
59
|
+
And stdout from "bundle exec vagrant service-manager env" should match /# eval "\$\(vagrant service-manager env\)"/
|
60
|
+
And stdout from "bundle exec vagrant service-manager env" should contain:
|
61
|
+
"""
|
62
|
+
# openshift env:
|
63
|
+
# You can access the OpenShift console on: https://<ip>:8443/console
|
64
|
+
# To use OpenShift CLI, run: oc login https://<ip>:8443
|
65
|
+
export OPENSHIFT_URL=https://<ip>:8443
|
66
|
+
export OPENSHIFT_WEB_CONSOLE=https://<ip>:8443/console
|
67
|
+
export DOCKER_REGISTRY=hub.openshift.centos7-adb.<ip>.xip.io
|
68
|
+
|
69
|
+
# run following command to configure your shell:
|
70
|
+
# eval "$(vagrant service-manager env)"
|
71
|
+
"""
|
72
|
+
|
73
|
+
When I successfully run `bundle exec vagrant up --provider <provider>`
|
74
|
+
And I run `bundle exec vagrant service-manager install-cli openshift`
|
75
|
+
Then the exit status should be 0
|
76
|
+
And the binary "oc" should be installed
|
77
|
+
|
78
|
+
Examples:
|
79
|
+
| box | provider | ip |
|
80
|
+
| adb | virtualbox | 10.10.10.42 |
|
81
|
+
| adb | libvirt | 10.10.10.42 |
|
@@ -1,5 +1,5 @@
|
|
1
|
-
Feature: Command output from various OpenShift related commands
|
2
|
-
service-manager should return the correct output from commands affecting OpenShift
|
1
|
+
Feature: Command output from various OpenShift related commands in CDK
|
2
|
+
service-manager should return the correct output from commands affecting OpenShift in CDK
|
3
3
|
|
4
4
|
@openshift
|
5
5
|
Scenario Outline: Boot and execute commands
|
@@ -55,7 +55,7 @@ Feature: Command output from various OpenShift related commands
|
|
55
55
|
Then stdout from "bundle exec vagrant service-manager env" should contain "export DOCKER_HOST=tcp://<ip>:2376"
|
56
56
|
And stdout from "bundle exec vagrant service-manager env" should match /export DOCKER_CERT_PATH=.*\/.vagrant\/machines\/cdk\/virtualbox\/docker/
|
57
57
|
And stdout from "bundle exec vagrant service-manager env" should contain "export DOCKER_TLS_VERIFY=1"
|
58
|
-
And stdout from "bundle exec vagrant service-manager env" should contain "export DOCKER_API_VERSION=1.
|
58
|
+
And stdout from "bundle exec vagrant service-manager env" should contain "export DOCKER_API_VERSION=1.2\d"
|
59
59
|
And stdout from "bundle exec vagrant service-manager env" should match /# eval "\$\(vagrant service-manager env\)"/
|
60
60
|
And stdout from "bundle exec vagrant service-manager env" should contain:
|
61
61
|
"""
|
data/features/support/env.rb
CHANGED
@@ -5,9 +5,8 @@ require 'find'
|
|
5
5
|
###############################################################################
|
6
6
|
# Aruba config and Cucumber hooks
|
7
7
|
###############################################################################
|
8
|
-
|
9
8
|
Aruba.configure do |config|
|
10
|
-
config.exit_timeout =
|
9
|
+
config.exit_timeout = 3600
|
11
10
|
config.activate_announcer_on_command_failure = [:stdout, :stderr]
|
12
11
|
config.working_directory = 'build/aruba'
|
13
12
|
end
|
@@ -21,9 +21,9 @@ module VagrantPlugins
|
|
21
21
|
data = Net::HTTP.get(URI(tag_url))
|
22
22
|
tokens = data.match("-v#{@version}-(.*)-#{archive_ext}").captures
|
23
23
|
tokens.first unless tokens.empty?
|
24
|
-
rescue StandardError
|
24
|
+
rescue StandardError
|
25
25
|
@ui.error e.message
|
26
|
-
|
26
|
+
raise I18n.t('servicemanager.commands.install_cli.unsupported_version')
|
27
27
|
end
|
28
28
|
|
29
29
|
def os_type
|
@@ -13,7 +13,7 @@ module VagrantPlugins
|
|
13
13
|
}.freeze
|
14
14
|
VERSION_CMD = {
|
15
15
|
docker: "docker version --format '{{.Server.Version}}'",
|
16
|
-
openshift: "oc version | grep 'oc' |
|
16
|
+
openshift: "oc version | grep -oE 'oc v([0-9a-z.]+-?[a-z0-9]*.?[0-9])' | sed -E 's/oc v//'"
|
17
17
|
}.freeze
|
18
18
|
BINARY_REGEX = {
|
19
19
|
windows: { docker: %r{\/docker.exe$}, openshift: /oc.exe$/ },
|
@@ -100,9 +100,11 @@ module VagrantPlugins
|
|
100
100
|
req.use_ssl = true if url.scheme == 'https'
|
101
101
|
res = req.request_head(url.path)
|
102
102
|
|
103
|
-
unless res.code
|
103
|
+
unless %w(200 302).include? res.code
|
104
104
|
raise URLValidationError, I18n.t('servicemanager.commands.install_cli.url_validation_error')
|
105
105
|
end
|
106
|
+
|
107
|
+
true
|
106
108
|
end
|
107
109
|
|
108
110
|
private
|
data/locales/en.yml
CHANGED
@@ -188,6 +188,10 @@ en:
|
|
188
188
|
'%{service}' service is not enabled.
|
189
189
|
kube_not_supported: |-
|
190
190
|
Installation of Kubernetes client library via the install-cli command is not supported yet.
|
191
|
+
unsupported_version: |-
|
192
|
+
Something went wrong to find the correct download link.
|
193
|
+
We recommend you to use '--cli-version' for your desired client version.
|
194
|
+
If still facing issues, please report to https://github.com/projectatomic/vagrant-service-manager.
|
191
195
|
|
192
196
|
status:
|
193
197
|
nil: |-
|
@@ -54,6 +54,11 @@ module VagrantPlugins
|
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'should validate download url' do
|
57
|
+
@handler.build_download_url
|
58
|
+
@handler.validate_url.must_equal true
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'should raise error with invalid --cli-version' do
|
57
62
|
@options['--cli-version'] = '111.222.333'
|
58
63
|
@handler = ADBDockerBinaryHandler.new(@machine, @machine.env, @options)
|
59
64
|
@handler.build_download_url
|
@@ -45,6 +45,11 @@ module VagrantPlugins
|
|
45
45
|
end
|
46
46
|
|
47
47
|
it 'should validate download url' do
|
48
|
+
@handler.build_download_url
|
49
|
+
@handler.validate_url.must_equal true
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'should raise error with invalid --cli-version' do
|
48
53
|
@options['--cli-version'] = '111.222.333'
|
49
54
|
@handler = ADBDockerBinaryHandler.new(@machine, @machine.env, @options)
|
50
55
|
@handler.build_download_url
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-service-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Exelbierd
|
@@ -9,20 +9,20 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-08-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubyzip
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - ~>
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 1.2.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - ~>
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 1.2.0
|
28
28
|
description: Provides setup information, including environment variables and certificates,
|
@@ -34,15 +34,16 @@ executables: []
|
|
34
34
|
extensions: []
|
35
35
|
extra_rdoc_files: []
|
36
36
|
files:
|
37
|
-
- .ci/ansible/roles/centos/tasks/main.yml
|
38
|
-
- .ci/ansible/roles/centos/vars/main.yml
|
39
|
-
- .ci/ansible/site.yml
|
40
|
-
- .ci/jenkins-execute-script.py
|
41
|
-
- .config/cucumber.yml
|
42
|
-
- .gitattributes
|
43
|
-
- .
|
44
|
-
- .
|
45
|
-
- .
|
37
|
+
- ".ci/ansible/roles/centos/tasks/main.yml"
|
38
|
+
- ".ci/ansible/roles/centos/vars/main.yml"
|
39
|
+
- ".ci/ansible/site.yml"
|
40
|
+
- ".ci/jenkins-execute-script.py"
|
41
|
+
- ".config/cucumber.yml"
|
42
|
+
- ".gitattributes"
|
43
|
+
- ".github/ISSUE_TEMPLATE.MD"
|
44
|
+
- ".gitignore"
|
45
|
+
- ".rubocop.yml"
|
46
|
+
- ".rubocop_todo.yml"
|
46
47
|
- CHANGELOG.md
|
47
48
|
- CONTRIBUTING.adoc
|
48
49
|
- Gemfile
|
@@ -50,11 +51,12 @@ files:
|
|
50
51
|
- README.adoc
|
51
52
|
- Rakefile
|
52
53
|
- commands.adoc
|
54
|
+
- features/adb-openshift.feature
|
53
55
|
- features/box-command.feature
|
56
|
+
- features/cdk-openshift.feature
|
54
57
|
- features/env-command.feature
|
55
58
|
- features/help-command.feature
|
56
59
|
- features/install-cli.feature
|
57
|
-
- features/openshift.feature
|
58
60
|
- features/service-operation.feature
|
59
61
|
- features/support/env.rb
|
60
62
|
- lib/vagrant-service-manager.rb
|
@@ -114,17 +116,17 @@ require_paths:
|
|
114
116
|
- lib
|
115
117
|
required_ruby_version: !ruby/object:Gem::Requirement
|
116
118
|
requirements:
|
117
|
-
- -
|
119
|
+
- - ">="
|
118
120
|
- !ruby/object:Gem::Version
|
119
121
|
version: '0'
|
120
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
123
|
requirements:
|
122
|
-
- -
|
124
|
+
- - ">="
|
123
125
|
- !ruby/object:Gem::Version
|
124
126
|
version: '0'
|
125
127
|
requirements: []
|
126
128
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.4.
|
129
|
+
rubygems_version: 2.4.8
|
128
130
|
signing_key:
|
129
131
|
specification_version: 4
|
130
132
|
summary: To provide the user a CLI to configure the ADB/CDK for different use cases
|