vagrant-service-manager 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -3
- data/CHANGELOG.md +4 -0
- data/features/adb-openshift.feature +3 -28
- data/lib/vagrant-service-manager/action/log_configured_service.rb +26 -0
- data/lib/vagrant-service-manager/action/setup_network.rb +1 -4
- data/lib/vagrant-service-manager/command.rb +8 -0
- data/lib/vagrant-service-manager/plugin.rb +7 -0
- data/lib/vagrant-service-manager/plugin_util.rb +0 -2
- data/lib/vagrant-service-manager/services/docker.rb +3 -0
- data/lib/vagrant-service-manager/services/kubernetes.rb +3 -0
- data/lib/vagrant-service-manager/services/open_shift.rb +3 -0
- data/lib/vagrant-service-manager/version.rb +1 -1
- data/locales/en.yml +9 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54c81b4b64ff2de2506fa8fc9436a50655edea16
|
4
|
+
data.tar.gz: 06822f05ffd1fe483965fe356de9f243d5d216a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 995db1cf5395f6984c2fff80497b1d691ddb7aeb76b514c9bcb45b92045e6af8af848495c9732d7ca213a273db2499301d4fdd536b6662c0a79c3fd100471ae2
|
7
|
+
data.tar.gz: 45a3c8d775b2fde742fdf89c5291c6621791de45fcbdd4e27ca841b6897a6b231ed99adee3b04203475fa5648b5afb33047a559d5702095f3516a988516a63e6
|
data/.rubocop.yml
CHANGED
@@ -4,10 +4,12 @@ AllCops:
|
|
4
4
|
Exclude:
|
5
5
|
- 'build/**/*'
|
6
6
|
|
7
|
-
# Offense count: 57
|
8
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
9
|
-
# URISchemes: http, https
|
10
7
|
Metrics/LineLength:
|
11
8
|
Max: 120
|
12
9
|
Exclude:
|
13
10
|
- 'Rakefile'
|
11
|
+
|
12
|
+
Metrics/ClassLength:
|
13
|
+
Max: 209
|
14
|
+
Exclude:
|
15
|
+
- 'lib/vagrant-service-manager/command.rb'
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v1.3.1 Aug 25, 2016
|
4
|
+
- Fix #257 proper error message on restarting a stopped service @budhrg
|
5
|
+
- Fix #379 Success message after vagrant up for Kubernetes @budhrg
|
6
|
+
|
3
7
|
## v1.3.0 Aug 12, 2016
|
4
8
|
- Fix #374 Fix kubernetes acceptance test @budhrg
|
5
9
|
- Fix #372 Detect already downloaded oc binary in Windows @budhrg
|
@@ -18,17 +18,13 @@ Feature: Command output from various OpenShift related commands in ADB
|
|
18
18
|
config.vm.box_url = 'file://../../.boxes/<box>-<provider>.box'
|
19
19
|
config.vm.network :private_network, ip: '<ip>'
|
20
20
|
config.vm.synced_folder '.', '/vagrant', disabled: true
|
21
|
-
config.servicemanager.services = 'docker, openshift'
|
22
21
|
|
23
|
-
config.servicemanager.
|
24
|
-
config.servicemanager.openshift_image_name = 'openshift/origin'
|
25
|
-
config.servicemanager.openshift_docker_registry = 'docker.io'
|
22
|
+
config.servicemanager.services = 'docker, openshift'
|
26
23
|
end
|
27
24
|
"""
|
28
25
|
|
29
26
|
When I successfully run `bundle exec vagrant up --provider <provider>`
|
30
|
-
|
31
|
-
And I run `bundle exec vagrant service-manager env openshift`
|
27
|
+
And I successfully run `bundle exec vagrant service-manager env openshift`
|
32
28
|
Then stdout from "bundle exec vagrant service-manager env openshift" should be evaluable in a shell
|
33
29
|
And stdout from "bundle exec vagrant service-manager env openshift" should contain:
|
34
30
|
"""
|
@@ -51,31 +47,10 @@ Feature: Command output from various OpenShift related commands in ADB
|
|
51
47
|
DOCKER_REGISTRY=hub.openshift.centos7-adb.<ip>.xip.io
|
52
48
|
"""
|
53
49
|
|
54
|
-
When I
|
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`
|
50
|
+
When I run `bundle exec vagrant service-manager install-cli openshift`
|
75
51
|
Then the exit status should be 0
|
76
52
|
And the binary "oc" should be installed
|
77
53
|
|
78
54
|
Examples:
|
79
55
|
| box | provider | ip |
|
80
56
|
| adb | virtualbox | 10.10.10.42 |
|
81
|
-
| adb | libvirt | 10.10.10.42 |
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module ServiceManager
|
3
|
+
module Action
|
4
|
+
class LogConfiguredServices
|
5
|
+
def initialize(app, env)
|
6
|
+
@app = app
|
7
|
+
@machine = env[:machine]
|
8
|
+
@ui = env[:ui]
|
9
|
+
@services = @machine.config.servicemanager.services.split(',').map(&:strip)
|
10
|
+
end
|
11
|
+
|
12
|
+
def call(env)
|
13
|
+
@app.call(env)
|
14
|
+
|
15
|
+
@services.each do |service|
|
16
|
+
if !PluginUtil.service_running?(@machine, service)
|
17
|
+
@ui.info I18n.t('servicemanager.actions.service_failure', service: service.capitalize)
|
18
|
+
elsif PluginUtil.service_running?(@machine, service)
|
19
|
+
@ui.info I18n.t('servicemanager.actions.service_success', service: service.capitalize)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -24,10 +24,7 @@ module VagrantPlugins
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def add_private_network
|
27
|
-
@ui.info
|
28
|
-
When using virtualbox, a non-NAT network interface is required.
|
29
|
-
Adding a private network using DHCP
|
30
|
-
MSG
|
27
|
+
@ui.info I18n.t('servicemanager.action.private_network')
|
31
28
|
@machine.config.vm.network :private_network, type: :dhcp
|
32
29
|
end
|
33
30
|
end
|
@@ -248,6 +248,14 @@ module VagrantPlugins
|
|
248
248
|
PluginUtil.generate_kubeconfig(machine, @env.ui, File.dirname(ServiceManager.bin_dir))
|
249
249
|
end
|
250
250
|
end
|
251
|
+
rescue StandardError => e
|
252
|
+
if operation == 'restart' && e.message.include?("Start #{service} first")
|
253
|
+
@env.ui.error I18n.t('servicemanager.commands.operation.start_service_first')
|
254
|
+
else
|
255
|
+
@env.ui.error e.message.squeeze
|
256
|
+
end
|
257
|
+
|
258
|
+
exit 126
|
251
259
|
end
|
252
260
|
|
253
261
|
def display_box_ip(script_readable = false)
|
@@ -21,6 +21,7 @@ module VagrantPlugins
|
|
21
21
|
action_hook(:servicemanager, :machine_action_up) do |hook|
|
22
22
|
hook.before(VagrantPlugins::ProviderVirtualBox::Action::Network, setup_network)
|
23
23
|
hook.after(Vagrant::Action::Builtin::SyncedFolders, Service)
|
24
|
+
hook.after Vagrant::Action::Builtin::Provision, final_actions
|
24
25
|
end
|
25
26
|
|
26
27
|
def self.setup_network
|
@@ -28,6 +29,12 @@ module VagrantPlugins
|
|
28
29
|
b.use Action::SetupNetwork
|
29
30
|
end
|
30
31
|
end
|
32
|
+
|
33
|
+
def self.final_actions
|
34
|
+
Vagrant::Action::Builder.new.tap do |b|
|
35
|
+
b.use Action::LogConfiguredServices
|
36
|
+
end
|
37
|
+
end
|
31
38
|
end
|
32
39
|
end
|
33
40
|
end
|
@@ -13,6 +13,9 @@ module VagrantPlugins
|
|
13
13
|
exit_code = PluginUtil.execute_and_exit_on_fail(@machine, @ui, command)
|
14
14
|
PluginUtil.generate_kubeconfig(@machine, @ui, @plugin_dir) if exit_code.zero?
|
15
15
|
end
|
16
|
+
rescue StandardError => e
|
17
|
+
@ui.error e.message.squeeze
|
18
|
+
exit 126
|
16
19
|
end
|
17
20
|
|
18
21
|
def status
|
@@ -16,6 +16,9 @@ module VagrantPlugins
|
|
16
16
|
end
|
17
17
|
rescue Vagrant::Errors::GuestCapabilityNotFound
|
18
18
|
PluginLogger.debug('Guest capability not found while starting OpenShift service')
|
19
|
+
rescue StandardError => e
|
20
|
+
@ui.error e.message.squeeze
|
21
|
+
exit 126
|
19
22
|
end
|
20
23
|
|
21
24
|
def status
|
data/locales/en.yml
CHANGED
@@ -187,6 +187,7 @@ en:
|
|
187
187
|
sccli_only_support: |-
|
188
188
|
Only sccli services are supported. For example:
|
189
189
|
docker, openshift and kubernetes
|
190
|
+
start_service_first: 'Please start the service first before restarting.'
|
190
191
|
install_cli:
|
191
192
|
message: |-
|
192
193
|
# Binary %{when} available at %{path}
|
@@ -213,6 +214,14 @@ en:
|
|
213
214
|
Unknown service '%{service}'.
|
214
215
|
Supported services are %{services}.
|
215
216
|
|
217
|
+
# Action related translations
|
218
|
+
actions:
|
219
|
+
service_success: '%{service} service configured successfully...'
|
220
|
+
service_failure: '%{service} service failed to configure properly...'
|
221
|
+
private_network: |-
|
222
|
+
When using Virtualbox, a non-NAT network interface is required.
|
223
|
+
Adding a private network using DHCP
|
224
|
+
|
216
225
|
# Kube config template translation
|
217
226
|
kube_config: |-
|
218
227
|
apiVersion: v1
|
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.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Exelbierd
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-08-
|
12
|
+
date: 2016-08-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubyzip
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- features/service-operation.feature
|
62
62
|
- features/support/env.rb
|
63
63
|
- lib/vagrant-service-manager.rb
|
64
|
+
- lib/vagrant-service-manager/action/log_configured_service.rb
|
64
65
|
- lib/vagrant-service-manager/action/setup_network.rb
|
65
66
|
- lib/vagrant-service-manager/archive_handlers/tar_handler.rb
|
66
67
|
- lib/vagrant-service-manager/archive_handlers/zip_handler.rb
|