vagrant-service-manager 1.1.0.beta.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ci/ansible/roles/centos/tasks/main.yml +38 -0
- data/.ci/ansible/roles/centos/vars/main.yml +3 -0
- data/.ci/ansible/site.yml +4 -0
- data/.ci/jenkins-execute-script.py +79 -0
- data/.config/cucumber.yml +1 -0
- data/CHANGELOG.md +17 -1
- data/CONTRIBUTING.adoc +16 -22
- data/Gemfile +2 -2
- data/README.adoc +9 -18
- data/Rakefile +5 -2
- data/features/box-command.feature +5 -1
- data/features/env-command.feature +8 -1
- data/features/help-command.feature +5 -1
- data/features/openshift.feature +26 -2
- data/features/service-operation.feature +22 -2
- data/features/support/env.rb +5 -4
- data/lib/vagrant-service-manager/command.rb +7 -2
- data/lib/vagrant-service-manager/services/open_shift.rb +16 -1
- data/lib/vagrant-service-manager/version.rb +1 -1
- data/locales/en.yml +7 -0
- data/vagrant-service-manager.spec +32 -4
- metadata +8 -6
- data/features/debug-flag.feature +0 -30
- data/features/status-command.feature +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a07e2bb53c36d17f60301f92f65614e1ad0a0a53
|
4
|
+
data.tar.gz: 74b02d8dc2bdcdc63097538aca9de66de0169f04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6992490bc94977e327eab53a6feda53715e3df022a18e443340f7be9601d560ab257a4941f2982eee52672609a59c517f156c96f58316ce5eef74185fbb66351
|
7
|
+
data.tar.gz: 25d843b9d45177b669eb8764c0e95366b83576bee53e03fceedc7deaf0c6af37d1da59e0f5b40091cf54fe8e6737f7b305f777349b0a3deaeac51708adbcb6cc
|
@@ -0,0 +1,38 @@
|
|
1
|
+
- name: Enable centos-release-scl repo
|
2
|
+
yum: name=centos-release-scl state=latest
|
3
|
+
|
4
|
+
- name: Setup Vagrant
|
5
|
+
yum: name={{item}} state=latest
|
6
|
+
with_items:
|
7
|
+
- sclo-vagrant1
|
8
|
+
- rsync
|
9
|
+
|
10
|
+
- name: Setup libvirt
|
11
|
+
yum: name={{item}} state=latest
|
12
|
+
with_items:
|
13
|
+
- qemu-kvm
|
14
|
+
- sclo-vagrant1-vagrant-libvirt
|
15
|
+
|
16
|
+
- name: Setup VirtualBox dependencies
|
17
|
+
yum: name={{item}} state=latest
|
18
|
+
with_items:
|
19
|
+
- gcc
|
20
|
+
- kernel-devel
|
21
|
+
|
22
|
+
- name: Install VirtualBox
|
23
|
+
yum: name=http://download.virtualbox.org/virtualbox/rpm/rhel/7/x86_64/VirtualBox-5.0-5.0.8_103449_el7-1.x86_64.rpm state=present
|
24
|
+
|
25
|
+
- name: start-enable-libvirtd
|
26
|
+
service: name=libvirtd state=started enabled=yes
|
27
|
+
|
28
|
+
- name: Setup Ruby dev environment
|
29
|
+
yum: name={{item}} state=latest
|
30
|
+
with_items:
|
31
|
+
- zlib-devel
|
32
|
+
- ruby-devel
|
33
|
+
- rh-ruby22-ruby-devel
|
34
|
+
- libvirt-devel
|
35
|
+
|
36
|
+
- name: Install Development Tools
|
37
|
+
yum: name="@Development tools" state=present
|
38
|
+
|
@@ -0,0 +1,79 @@
|
|
1
|
+
#!/usr/bin/python
|
2
|
+
|
3
|
+
import os
|
4
|
+
import json
|
5
|
+
import urllib
|
6
|
+
import subprocess
|
7
|
+
import sys
|
8
|
+
|
9
|
+
url_base = "http://admin.ci.centos.org:8080"
|
10
|
+
api_key = os.environ['API_KEY']
|
11
|
+
count = os.environ['MACHINE_COUNT'] if os.environ.get('MACHINE_COUNT') != None else "1"
|
12
|
+
ver = "7"
|
13
|
+
arch = "x86_64"
|
14
|
+
req_url = "%s/Node/get?key=%s&ver=%s&arch=%s&count=%s" % (url_base, api_key, ver, arch, count)
|
15
|
+
|
16
|
+
jsondata = urllib.urlopen(req_url).read()
|
17
|
+
data = json.loads(jsondata)
|
18
|
+
|
19
|
+
# Setup some variables. Can be passed as env variables via the job config. Otherwise defaults apply
|
20
|
+
repo_url = os.environ['REPO_URL'] if os.environ.get('REPO_URL') != None else 'https://github.com/projectatomic/vagrant-service-manager.git'
|
21
|
+
branch = os.environ['BRANCH'] if os.environ.get('BRANCH') != None else 'master'
|
22
|
+
|
23
|
+
def execute_on_host( host, cmd, error_message ):
|
24
|
+
# build command to execute install and test commands via ssh
|
25
|
+
ssh_cmd = "ssh -t -t "
|
26
|
+
ssh_cmd += "-o UserKnownHostsFile=/dev/null "
|
27
|
+
ssh_cmd += "-o StrictHostKeyChecking=no "
|
28
|
+
ssh_cmd += "root@%s " % (host)
|
29
|
+
|
30
|
+
cmd = '%s "%s"' % (ssh_cmd, cmd)
|
31
|
+
print "Executing: %s" % (cmd)
|
32
|
+
exit_code = subprocess.call(cmd, shell=True)
|
33
|
+
if exit_code != 0 : sys.exit(error_message)
|
34
|
+
return
|
35
|
+
|
36
|
+
def prepare_pull_request_build(host):
|
37
|
+
pr_branch = os.environ['ghprbSourceBranch']
|
38
|
+
pr_author_repo = os.environ['ghprbAuthorRepoGitUrl']
|
39
|
+
|
40
|
+
branch_cmd = 'cd vagrant-service-manager && '
|
41
|
+
branch_cmd += "git checkout -b %s" % (pr_branch)
|
42
|
+
execute_on_host(host, branch_cmd, "Unable to create branch for pull request build")
|
43
|
+
|
44
|
+
pull_cmd = 'cd vagrant-service-manager && '
|
45
|
+
pull_cmd += "git pull --no-edit %s %s " % (pr_author_repo, pr_branch)
|
46
|
+
execute_on_host(host, pull_cmd, "Unable to pull pull request")
|
47
|
+
return
|
48
|
+
|
49
|
+
for host in data['hosts']:
|
50
|
+
|
51
|
+
# run the Ansible playbook
|
52
|
+
ansible_cmd = 'yum -y install git epel-release ansible1.9 && '
|
53
|
+
ansible_cmd += 'yum -y install ansible1.9 && '
|
54
|
+
ansible_cmd += 'git clone %s && ' % repo_url
|
55
|
+
ansible_cmd += 'cd vagrant-service-manager && '
|
56
|
+
ansible_cmd += 'git checkout %s && ' % branch
|
57
|
+
ansible_cmd += 'cd .ci/ansible && '
|
58
|
+
ansible_cmd += 'ANSIBLE_NOCOLOR=1 ansible-playbook site.yml'
|
59
|
+
execute_on_host(host, ansible_cmd, "Ansible playbook failed")
|
60
|
+
|
61
|
+
# if we deal with a pull request build we need to prepare the source
|
62
|
+
if os.environ.get('ghprbPullId') != None:
|
63
|
+
prepare_pull_request_build(host)
|
64
|
+
|
65
|
+
# setup the environment
|
66
|
+
setup_cmd = 'cd vagrant-service-manager && '
|
67
|
+
setup_cmd += 'gem install bundler -v 1.10.0 && '
|
68
|
+
setup_cmd += 'bundle install --no-color'
|
69
|
+
execute_on_host(host, setup_cmd, "Unable to setup Ruby environment")
|
70
|
+
|
71
|
+
# run build and features
|
72
|
+
build_cmd = 'cd vagrant-service-manager && '
|
73
|
+
build_cmd += 'bundle exec rake build && '
|
74
|
+
build_cmd += 'bundle exec rake get_adb[\'libvirt\'] && '
|
75
|
+
build_cmd += 'bundle exec rake features CUCUMBER_OPTS=\'-p ci\' PROVIDER=libvirt'
|
76
|
+
execute_on_host(host, build_cmd, "Tests failures")
|
77
|
+
|
78
|
+
done_nodes_url = "%s/Node/done?key=%s&sside=%s" % (url_base, api_key, data['ssid'])
|
79
|
+
print urllib.urlopen(done_nodes_url)
|
data/.config/cucumber.yml
CHANGED
@@ -5,6 +5,7 @@ default: --profile html
|
|
5
5
|
|
6
6
|
pretty: --format pretty -b
|
7
7
|
html: --format progress --format html --out=build/features_report.html -b
|
8
|
+
ci: --format pretty --format html --out=build/features_report.html --no-color -b
|
8
9
|
|
9
10
|
help: --tags @help --profile html
|
10
11
|
box: --tags @box --profile html
|
data/CHANGELOG.md
CHANGED
@@ -1,15 +1,31 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
3
|
## Unreleased
|
4
|
+
|
5
|
+
## v1.1.0 Jun 08, 2016
|
4
6
|
- Updated README to make Installation Instructions clearer @bexelbie
|
5
|
-
- Fix #195 Adding Cucumber and Aruba based acceptance tests @hferentschik
|
7
|
+
- Fix #195: Adding Cucumber and Aruba based acceptance tests @hferentschik
|
6
8
|
- CHANGELOG fix and README update for OS support for tests @budhrg
|
9
|
+
- Fix #220: Bypass hook if no supported guest/box found @budhrg
|
10
|
+
- Issue #212 Updating the CONTRIBUTING page with latest guidelines @hferentschik
|
7
11
|
- Fix #188: Name of k8s service not consistent @budhrg
|
8
12
|
- Fix #225: service-manager env throws NameError @budhrg
|
9
13
|
- Fix #168: Extend --debug flag to show plugin activity @budhrg
|
14
|
+
- Fixed help messages for box and status commands @budhrg
|
10
15
|
- Don't set private network for unsupported box @budhrg
|
11
16
|
- Convert CONTRIBUTING and README docs to AsciiDoc @bexelbie
|
17
|
+
- Fix #235: Unable to access docker daemon from host @budhrg
|
12
18
|
- Fix #172: Implement "start/enable" service command @budhrg
|
19
|
+
- Issue #172 Modifying Rake CDK download task to allow downloading latest nightly build @hferentschik
|
20
|
+
- Pre-release v1.1.0.beta.1 @navidshaikh
|
21
|
+
- Fix #237: README and CONTRIBUTING should make use of Asciidoc's :toc: feature @hferentschik
|
22
|
+
- Fix #230: Improve acceptance test run time @hferentschik
|
23
|
+
- Fix #214: Update acceptance tests to support Mac OS without installing Libvirt @hferentschik
|
24
|
+
- Fix #247: Moved status test into service-operation @hferentschik
|
25
|
+
- Issue #211 Adding configuration for CI build @hferentschik
|
26
|
+
- Fix #210: Adds docker registry URL in openshift env info @navidshaikh
|
27
|
+
- Fix #250: status throws error with invalid service name @budhrg
|
28
|
+
- vagrant-service-manager release=1.1.0 version=1 @navidshaikh
|
13
29
|
|
14
30
|
## v1.0.2 May 09, 2016
|
15
31
|
- Add --script-readable to env and env docker @bexelbie
|
data/CONTRIBUTING.adoc
CHANGED
@@ -1,22 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
* link:#submitting-issues[Submitting issues]
|
5
|
-
* link:#submitting-pull-requests[Submitting pull requests]
|
6
|
-
** link:#get-started[Get Started]
|
7
|
-
** link:#create-a-topic-branch[Create a topic branch]
|
8
|
-
** link:#code[Code]
|
9
|
-
** link:#commit[Commit]
|
10
|
-
** link:#submit[Submit]
|
11
|
-
* link:#merging-pull-requests[Merging pull requests]
|
1
|
+
= Contributing to vagrant-service-manager
|
2
|
+
:toc:
|
3
|
+
:toc-placement!:
|
12
4
|
|
13
5
|
The following is a set of guidelines for contributing to the
|
14
|
-
vagrant-service-manager plugin.
|
6
|
+
vagrant-service-manager plugin. These are guidelines, please use your best
|
7
|
+
judgment and feel free to propose changes to this document.
|
15
8
|
|
16
|
-
|
17
|
-
|
9
|
+
'''
|
10
|
+
toc::[]
|
11
|
+
'''
|
18
12
|
|
19
|
-
|
13
|
+
== Submitting issues
|
20
14
|
|
21
15
|
You can submit issues with respect to the vagrant-service-manager plugin
|
22
16
|
https://github.com/projectatomic/vagrant-service-manager/issues/new[here].
|
@@ -31,9 +25,9 @@ Developer Bundle] and the
|
|
31
25
|
https://github.com/projectatomic/adb-utils/issues[adb-utils] RPM. You
|
32
26
|
may wish to review the issues in both these repositories as well.
|
33
27
|
|
34
|
-
|
28
|
+
== Submitting pull requests
|
35
29
|
|
36
|
-
|
30
|
+
=== Get Started
|
37
31
|
|
38
32
|
If you are just getting started with Git and GitHub there are a few
|
39
33
|
prerequisite steps.
|
@@ -46,7 +40,7 @@ this also includes:
|
|
46
40
|
git install.
|
47
41
|
** Cloning your fork.
|
48
42
|
|
49
|
-
|
43
|
+
=== Create a topic branch
|
50
44
|
|
51
45
|
Create a
|
52
46
|
http://git-scm.com/book/en/Git-Branching-Branching-Workflows#Topic-Branches[topic
|
@@ -57,12 +51,12 @@ link:#submitting-issues[submitting issues]). Assuming for example you
|
|
57
51
|
will be working from the master branch and working on the GitHub issue
|
58
52
|
123 : `git checkout -b issue-123 master`
|
59
53
|
|
60
|
-
|
54
|
+
=== Code
|
61
55
|
|
62
56
|
Do your work! Refer to the link:README.md#development[development]
|
63
57
|
section in the link:README.md[README] to get started.
|
64
58
|
|
65
|
-
|
59
|
+
=== Commit
|
66
60
|
|
67
61
|
* Make commits of logical units.
|
68
62
|
* Be sure to use the GitHub issue key in the commit message, eg
|
@@ -71,7 +65,7 @@ section in the link:README.md[README] to get started.
|
|
71
65
|
* Make sure you have added appropriate documentation updates.
|
72
66
|
* Run _all_ the tests to assure nothing else was accidentally broken.
|
73
67
|
|
74
|
-
|
68
|
+
=== Submit
|
75
69
|
|
76
70
|
* Push your changes to the topic branch in your fork of the repository.
|
77
71
|
* Initiate a https://help.github.com/articles/using-pull-requests/[pull
|
@@ -82,7 +76,7 @@ considered to be the first ACK. Therefore, pull requests from
|
|
82
76
|
maintainers only need one additional ACK. By "2 ACKs" we mean that two
|
83
77
|
maintainers must acknowledge that the change is a good one.
|
84
78
|
|
85
|
-
|
79
|
+
== Merging pull requests
|
86
80
|
|
87
81
|
A project maintainer will merge the pull request. He should avoid using
|
88
82
|
the GitHub UI for the merge and prefer merges over the the command line
|
data/Gemfile
CHANGED
@@ -5,8 +5,8 @@ gemspec
|
|
5
5
|
group :development do
|
6
6
|
gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git'
|
7
7
|
gem 'rake'
|
8
|
-
gem 'vagrant-libvirt'
|
9
|
-
gem 'fog-libvirt', '0.0.3' # https://github.com/pradels/vagrant-libvirt/issues/568
|
8
|
+
gem 'vagrant-libvirt' if RUBY_PLATFORM =~ /linux/i
|
9
|
+
gem 'fog-libvirt', '0.0.3' if RUBY_PLATFORM =~ /linux/i # https://github.com/pradels/vagrant-libvirt/issues/568
|
10
10
|
gem 'mechanize'
|
11
11
|
gem 'json'
|
12
12
|
gem 'cucumber', '~> 2.1'
|
data/README.adoc
CHANGED
@@ -1,21 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
** link:#installing-from-a-rubygems[Installing from a RubyGems]
|
7
|
-
** link:#installing-from-rpm[Installing from RPM]
|
8
|
-
* link:#usage[Usage]
|
9
|
-
** link:#example-execution-of-the-plugin[Example execution of the plugin]
|
10
|
-
** link:#available-commands[Available commands]
|
11
|
-
** link:#exit-codes[Exit codes]
|
12
|
-
** link:#ip-address-detection[IP address detection]
|
13
|
-
* link:#development[Development]
|
14
|
-
** link:#setup[Setup]
|
15
|
-
** link:#acceptance-tests[Acceptance tests]
|
16
|
-
* link:#getting-involved[Getting involved]
|
17
|
-
|
18
|
-
== Objective The vagrant-service-manager plugin is designed to enable
|
1
|
+
= vagrant-service-manager
|
2
|
+
:toc:
|
3
|
+
:toc-placement!:
|
4
|
+
|
5
|
+
The vagrant-service-manager plugin is designed to enable
|
19
6
|
easier access to the features and services provided by the
|
20
7
|
https://github.com/projectatomic/adb-atomic-developer-bundle[Atomic
|
21
8
|
Developer Bundle (ADB)]. It provides setup information, including
|
@@ -28,6 +15,10 @@ use ADB with this plugin can be found in the
|
|
28
15
|
https://github.com/projectatomic/adb-atomic-developer-bundle/blob/master/docs/using.rst[ADB
|
29
16
|
Documentation].
|
30
17
|
|
18
|
+
'''
|
19
|
+
toc::[]
|
20
|
+
'''
|
21
|
+
|
31
22
|
== Installation
|
32
23
|
|
33
24
|
The plugin is distributed as both a Ruby Gem and via RPM using the
|
data/Rakefile
CHANGED
@@ -19,12 +19,15 @@ CLEAN.include('build')
|
|
19
19
|
|
20
20
|
task :init do
|
21
21
|
FileUtils.mkdir_p 'build'
|
22
|
-
|
22
|
+
end
|
23
|
+
|
24
|
+
task :clean_for_testing do
|
25
|
+
FileUtils.rm_rf ['build/aruba', 'build/vagrant.d', 'build/features_report.html']
|
23
26
|
end
|
24
27
|
|
25
28
|
# Cucumber acceptance test tasks
|
26
29
|
Cucumber::Rake::Task.new(:features)
|
27
|
-
task :features => :init
|
30
|
+
task :features => [:init, :clean_for_testing]
|
28
31
|
|
29
32
|
namespace :features do
|
30
33
|
desc 'Opens the HTML Cucumber test report'
|
@@ -7,7 +7,11 @@ Feature: Command output from box command
|
|
7
7
|
And provider is <provider>
|
8
8
|
And a file named "Vagrantfile" with:
|
9
9
|
"""
|
10
|
-
|
10
|
+
begin
|
11
|
+
require 'vagrant-libvirt'
|
12
|
+
rescue LoadError
|
13
|
+
# NOOP
|
14
|
+
end
|
11
15
|
|
12
16
|
Vagrant.configure('2') do |config|
|
13
17
|
config.vm.box = '<box>'
|
@@ -7,7 +7,11 @@ Feature: Command output from env command
|
|
7
7
|
And provider is <provider>
|
8
8
|
And a file named "Vagrantfile" with:
|
9
9
|
"""
|
10
|
-
|
10
|
+
begin
|
11
|
+
require 'vagrant-libvirt'
|
12
|
+
rescue LoadError
|
13
|
+
# NOOP
|
14
|
+
end
|
11
15
|
|
12
16
|
Vagrant.configure('2') do |config|
|
13
17
|
config.vm.box = '<box>'
|
@@ -43,6 +47,9 @@ Feature: Command output from env command
|
|
43
47
|
# OpenShift service is not running in the vagrant box.
|
44
48
|
"""
|
45
49
|
|
50
|
+
When I successfully run `bundle exec vagrant service-manager env --debug`
|
51
|
+
Then stdout from "bundle exec vagrant service-manager env --debug" should match /DEBUG command: [ service-manager: env ]/
|
52
|
+
|
46
53
|
Examples:
|
47
54
|
| box | provider | ip |
|
48
55
|
| cdk | virtualbox | 10.10.10.42 |
|
@@ -7,7 +7,11 @@ Feature: Command output from help command
|
|
7
7
|
And provider is <provider>
|
8
8
|
And a file named "Vagrantfile" with:
|
9
9
|
"""
|
10
|
-
|
10
|
+
begin
|
11
|
+
require 'vagrant-libvirt'
|
12
|
+
rescue LoadError
|
13
|
+
# NOOP
|
14
|
+
end
|
11
15
|
|
12
16
|
Vagrant.configure('2') do |config|
|
13
17
|
config.vm.box = '<box>'
|
data/features/openshift.feature
CHANGED
@@ -7,7 +7,11 @@ Feature: Command output from various OpenShift related commands
|
|
7
7
|
And provider is <provider>
|
8
8
|
And a file named "Vagrantfile" with:
|
9
9
|
"""
|
10
|
-
|
10
|
+
begin
|
11
|
+
require 'vagrant-libvirt'
|
12
|
+
rescue LoadError
|
13
|
+
# NOOP
|
14
|
+
end
|
11
15
|
|
12
16
|
Vagrant.configure('2') do |config|
|
13
17
|
config.vm.box = '<box>'
|
@@ -32,6 +36,7 @@ Feature: Command output from various OpenShift related commands
|
|
32
36
|
# To use OpenShift CLI, run: oc login https://<ip>:8443
|
33
37
|
export OPENSHIFT_URL=https://<ip>:8443
|
34
38
|
export OPENSHIFT_WEB_CONSOLE=https://<ip>:8443/console
|
39
|
+
export DOCKER_REGISTRY=hub.openshift.rhel-cdk.<ip>.xip.io
|
35
40
|
|
36
41
|
# run following command to configure your shell:
|
37
42
|
# eval "$(vagrant service-manager env openshift)"
|
@@ -43,9 +48,28 @@ Feature: Command output from various OpenShift related commands
|
|
43
48
|
"""
|
44
49
|
OPENSHIFT_URL=https://<ip>:8443
|
45
50
|
OPENSHIFT_WEB_CONSOLE=https://<ip>:8443/console
|
51
|
+
DOCKER_REGISTRY=hub.openshift.rhel-cdk.<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 contain "export DOCKER_API_VERSION=1.21"
|
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.rhel-cdk.<ip>.xip.io
|
68
|
+
# run following command to configure your shell:
|
69
|
+
# eval "$(vagrant service-manager env)"
|
46
70
|
"""
|
47
71
|
|
48
72
|
Examples:
|
49
73
|
| box | provider | ip |
|
50
74
|
| cdk | virtualbox | 10.10.10.42 |
|
51
|
-
| cdk | libvirt | 10.10.10.42 |
|
75
|
+
| cdk | libvirt | 10.10.10.42 |
|
@@ -7,7 +7,11 @@ Feature: Command output from service operations like stop/start/restart
|
|
7
7
|
And provider is <provider>
|
8
8
|
And a file named "Vagrantfile" with:
|
9
9
|
"""
|
10
|
-
|
10
|
+
begin
|
11
|
+
require 'vagrant-libvirt'
|
12
|
+
rescue LoadError
|
13
|
+
# NOOP
|
14
|
+
end
|
11
15
|
|
12
16
|
Vagrant.configure('2') do |config|
|
13
17
|
config.vm.box = '<box>'
|
@@ -19,7 +23,23 @@ Feature: Command output from service operations like stop/start/restart
|
|
19
23
|
"""
|
20
24
|
|
21
25
|
When I successfully run `bundle exec vagrant up --provider <provider>`
|
22
|
-
And
|
26
|
+
And I successfully run `bundle exec vagrant service-manager status`
|
27
|
+
Then stdout from "bundle exec vagrant service-manager status" should contain "docker - running"
|
28
|
+
Then stdout from "bundle exec vagrant service-manager status" should contain "openshift - stopped"
|
29
|
+
Then stdout from "bundle exec vagrant service-manager status" should contain "kubernetes - stopped"
|
30
|
+
|
31
|
+
When I successfully run `bundle exec vagrant service-manager status docker`
|
32
|
+
Then stdout from "bundle exec vagrant service-manager status" should contain "docker - running"
|
33
|
+
|
34
|
+
When I run `bundle exec vagrant service-manager status abcd`
|
35
|
+
Then the exit status should be 126
|
36
|
+
And stderr from "bundle exec vagrant service-manager status abcd" should contain:
|
37
|
+
"""
|
38
|
+
Unkown service 'abcd'.
|
39
|
+
Supported services are docker, openshift, kubernetes etc.
|
40
|
+
"""
|
41
|
+
|
42
|
+
When the "docker" service is running
|
23
43
|
And I successfully run `bundle exec vagrant service-manager stop docker`
|
24
44
|
Then the service "docker" should be stopped
|
25
45
|
|
data/features/support/env.rb
CHANGED
@@ -11,6 +11,11 @@ Aruba.configure do |config|
|
|
11
11
|
config.working_directory = 'build/aruba'
|
12
12
|
end
|
13
13
|
|
14
|
+
Before do |scenario|
|
15
|
+
@scenario_name = scenario.name
|
16
|
+
ENV['VAGRANT_HOME'] = File.join(File.dirname(__FILE__), '..', '..', 'build', 'vagrant.d')
|
17
|
+
end
|
18
|
+
|
14
19
|
After do |_scenario|
|
15
20
|
if File.exist?(File.join(aruba.config.working_directory, 'Vagrantfile'))
|
16
21
|
Komenda.run('bundle exec vagrant destroy -f', cwd: aruba.config.working_directory, fail_on_fail: true)
|
@@ -22,10 +27,6 @@ After do |_scenario|
|
|
22
27
|
end
|
23
28
|
end
|
24
29
|
|
25
|
-
Before do |scenario|
|
26
|
-
@scenario_name = scenario.name
|
27
|
-
end
|
28
|
-
|
29
30
|
###############################################################################
|
30
31
|
# Some helper functions
|
31
32
|
###############################################################################
|
@@ -141,13 +141,18 @@ module VagrantPlugins
|
|
141
141
|
|
142
142
|
def execute_status_display(service = nil)
|
143
143
|
with_target_vms(nil, single_target: true) do |machine|
|
144
|
-
if service
|
144
|
+
if service && SUPPORTED_SERVICES.include?(service)
|
145
145
|
PluginUtil.service_class(service).status(machine, @env.ui, service)
|
146
|
-
|
146
|
+
elsif service.nil?
|
147
147
|
@env.ui.info I18n.t('servicemanager.commands.status.nil')
|
148
148
|
SUPPORTED_SERVICES.each do |s|
|
149
149
|
PluginUtil.service_class(s).status(machine, @env.ui, s)
|
150
150
|
end
|
151
|
+
else
|
152
|
+
@env.ui.error I18n.t('servicemanager.commands.status.unsupported_service',
|
153
|
+
service: service,
|
154
|
+
services: SUPPORTED_SERVICES.join(', ') + ' etc')
|
155
|
+
exit 126
|
151
156
|
end
|
152
157
|
end
|
153
158
|
end
|
@@ -18,12 +18,26 @@ module VagrantPlugins
|
|
18
18
|
PluginUtil.print_service_status(ui, machine, service)
|
19
19
|
end
|
20
20
|
|
21
|
+
def self.docker_registry_host(machine)
|
22
|
+
url = ''
|
23
|
+
PluginLogger.debug
|
24
|
+
command = \
|
25
|
+
"sudo oc --config=/var/lib/openshift/openshift.local." +
|
26
|
+
"config/master/admin.kubeconfig get route/docker-registry " +
|
27
|
+
"-o template --template={{.spec.host}}"
|
28
|
+
machine.communicate.execute(command) do |type, data|
|
29
|
+
url << data.chomp if type == :stdout
|
30
|
+
end
|
31
|
+
url
|
32
|
+
end
|
33
|
+
|
21
34
|
def self.info(machine, ui, options = {})
|
22
35
|
options[:script_readable] ||= false
|
23
36
|
|
24
37
|
if PluginUtil.service_running?(machine, 'openshift')
|
25
38
|
options[:url] = "https://#{PluginUtil.machine_ip(machine)}:#{OPENSHIFT_PORT}"
|
26
39
|
options[:console_url] = "#{options[:url]}/console"
|
40
|
+
options[:docker_registry] = docker_registry_host(machine)
|
27
41
|
print_info(ui, options)
|
28
42
|
else
|
29
43
|
ui.error I18n.t('servicemanager.commands.env.service_not_running',
|
@@ -38,7 +52,8 @@ module VagrantPlugins
|
|
38
52
|
label = PluginUtil.env_label(options[:script_readable])
|
39
53
|
message = I18n.t("servicemanager.commands.env.openshift.#{label}",
|
40
54
|
openshift_url: options[:url],
|
41
|
-
openshift_console_url: options[:console_url]
|
55
|
+
openshift_console_url: options[:console_url],
|
56
|
+
docker_registry: options[:docker_registry])
|
42
57
|
ui.info(message)
|
43
58
|
unless options[:script_readable] || options[:all]
|
44
59
|
PluginUtil.print_shell_configure_info(ui, ' openshift')
|
data/locales/en.yml
CHANGED
@@ -120,19 +120,23 @@ en:
|
|
120
120
|
# To use OpenShift CLI, run: oc login %{openshift_url}
|
121
121
|
setx OPENSHIFT_URL %{openshift_url}
|
122
122
|
setx OPENSHIFT_WEB_CONSOLE %{openshift_console_url}
|
123
|
+
setx DOCKER_REGISTRY %{docker_registry}
|
123
124
|
non_windows: |-
|
124
125
|
# You can access the OpenShift console on: %{openshift_console_url}
|
125
126
|
# To use OpenShift CLI, run: oc login %{openshift_url}
|
126
127
|
export OPENSHIFT_URL=%{openshift_url}
|
127
128
|
export OPENSHIFT_WEB_CONSOLE=%{openshift_console_url}
|
129
|
+
export DOCKER_REGISTRY=%{docker_registry}
|
128
130
|
windows_cygwin: |-
|
129
131
|
# You can access the OpenShift console on: %{openshift_console_url}
|
130
132
|
# To use OpenShift CLI, run: oc login %{openshift_url}
|
131
133
|
export OPENSHIFT_URL=%{openshift_url}
|
132
134
|
export OPENSHIFT_WEB_CONSOLE=%{openshift_console_url}
|
135
|
+
export DOCKER_REGISTRY=%{docker_registry}
|
133
136
|
script_readable: |-
|
134
137
|
OPENSHIFT_URL=%{openshift_url}
|
135
138
|
OPENSHIFT_WEB_CONSOLE=%{openshift_console_url}
|
139
|
+
DOCKER_REGISTRY=%{docker_registry}
|
136
140
|
windows_cygwin_configure_info: |-
|
137
141
|
# run following command to configure your shell:
|
138
142
|
# eval "$(VAGRANT_NO_COLOR=1 vagrant service-manager env%{command} | tr -d '\r')"
|
@@ -153,3 +157,6 @@ en:
|
|
153
157
|
status:
|
154
158
|
running: running
|
155
159
|
stopped: stopped
|
160
|
+
unsupported_service: |-
|
161
|
+
Unkown service '%{service}'.
|
162
|
+
Supported services are %{services}.
|
@@ -2,7 +2,7 @@
|
|
2
2
|
%global vagrant_plugin_name vagrant-service-manager
|
3
3
|
|
4
4
|
Name: %{vagrant_plugin_name}
|
5
|
-
Version: 1.0
|
5
|
+
Version: 1.1.0
|
6
6
|
Release: 1%{?dist}
|
7
7
|
Summary: To provide the user a CLI to configure the ADB/CDK for different use cases and to provide glue between ADB/CDK and the user's developer environment.
|
8
8
|
Group: Development/Languages
|
@@ -71,14 +71,16 @@ popd
|
|
71
71
|
%{vagrant_plugin_spec}
|
72
72
|
%{vagrant_plugin_instdir}/plugins/guests/
|
73
73
|
%{vagrant_plugin_instdir}/locales/
|
74
|
+
%exclude %{vagrant_plugin_instdir}/.ci
|
75
|
+
%exclude %{vagrant_plugin_instdir}/.config
|
74
76
|
|
75
77
|
%files doc
|
76
78
|
%doc %{vagrant_plugin_docdir}
|
77
79
|
%{vagrant_plugin_instdir}/Gemfile
|
78
|
-
%doc %{vagrant_plugin_instdir}/README.
|
80
|
+
%doc %{vagrant_plugin_instdir}/README.adoc
|
79
81
|
%{vagrant_plugin_instdir}/Rakefile
|
80
82
|
%{vagrant_plugin_instdir}/Vagrantfile
|
81
|
-
%{vagrant_plugin_instdir}/CONTRIBUTING.
|
83
|
+
%{vagrant_plugin_instdir}/CONTRIBUTING.adoc
|
82
84
|
%{vagrant_plugin_instdir}/LICENSE
|
83
85
|
%{vagrant_plugin_instdir}/MAINTAINERS
|
84
86
|
%{vagrant_plugin_instdir}/vagrant-service-manager.gemspec
|
@@ -86,8 +88,35 @@ popd
|
|
86
88
|
%{vagrant_plugin_instdir}/CHANGELOG.md
|
87
89
|
%{vagrant_plugin_instdir}/TODO
|
88
90
|
%{vagrant_plugin_instdir}/.gitattributes
|
91
|
+
%{vagrant_plugin_instdir}/features
|
89
92
|
|
90
93
|
%changelog
|
94
|
+
* Wed Jun 08 2016 Navid Shaikh - 1.1.0-1
|
95
|
+
- Bumps verison to 1.1.0
|
96
|
+
- Updated README to make Installation Instructions clearer @bexelbie
|
97
|
+
- Fix #195: Adding Cucumber and Aruba based acceptance tests @hferentschik
|
98
|
+
- CHANGELOG fix and README update for OS support for tests @budhrg
|
99
|
+
- Fix #220: Bypass hook if no supported guest/box found @budhrg
|
100
|
+
- Issue #212 Updating the CONTRIBUTING page with latest guidelines @hferentschik
|
101
|
+
- Fix #188: Name of k8s service not consistent @budhrg
|
102
|
+
- Fix #225: service-manager env throws NameError @budhrg
|
103
|
+
- Fix #168: Extend --debug flag to show plugin activity @budhrg
|
104
|
+
- Fixed help messages for box and status commands @budhrg
|
105
|
+
- Don't set private network for unsupported box @budhrg
|
106
|
+
- Convert CONTRIBUTING and README docs to AsciiDoc @bexelbie
|
107
|
+
- Fix #235: Unable to access docker daemon from host @navidshaikh
|
108
|
+
- Fix #172: Implement "start/enable" service command @budhrg
|
109
|
+
- Issue #172 Modifying Rake CDK download task to allow downloading latest nightly build @hferentschik
|
110
|
+
- Pre-release v1.1.0.beta.1 @navidshaikh
|
111
|
+
- Fix #237: README and CONTRIBUTING should make use of Asciidoc's :toc: feature @hferentschik
|
112
|
+
- Fix #230: Improve acceptance test run time @hferentschik
|
113
|
+
- Fix #214: Update acceptance tests to support Mac OS without installing Libvirt @hferentschik
|
114
|
+
- Fix #247: Moved status test into service-operation @hferentschik
|
115
|
+
- Issue #211 Adding configuration for CI build @hferentschik
|
116
|
+
- Fix #210: Adds docker registry URL in openshift env info @navidshaikh
|
117
|
+
- Fix #250: status throws error with invalid service name @budhrg
|
118
|
+
- vagrant-service-manager release=1.1.0 version=1 @navidshaikh
|
119
|
+
|
91
120
|
* Mon May 09 2016 Navid Shaikh - 1.0.2-1
|
92
121
|
- Add --script-readable to env and env docker @bexelbie
|
93
122
|
- Fix #178: Add status command and separate status from env @bexelbie
|
@@ -103,7 +132,6 @@ popd
|
|
103
132
|
- Add environment variables for Openshift env output @bexelbie
|
104
133
|
- Fix #181: vagrant-service-manager version 1.0.2 release @navidshaikh
|
105
134
|
|
106
|
-
|
107
135
|
* Tue Apr 12 2016 Navid Shaikh - 1.0.1-1
|
108
136
|
- Updated SPEC (v1.0.0) for url, date and format @budhrg
|
109
137
|
- Added Table of Contents for README @bexelbie
|
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.1.0
|
4
|
+
version: 1.1.0
|
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-
|
12
|
+
date: 2016-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Provides setup information, including environment variables and certificates,
|
15
15
|
required to access services provided by ADB/CDK.
|
@@ -20,6 +20,10 @@ executables: []
|
|
20
20
|
extensions: []
|
21
21
|
extra_rdoc_files: []
|
22
22
|
files:
|
23
|
+
- ".ci/ansible/roles/centos/tasks/main.yml"
|
24
|
+
- ".ci/ansible/roles/centos/vars/main.yml"
|
25
|
+
- ".ci/ansible/site.yml"
|
26
|
+
- ".ci/jenkins-execute-script.py"
|
23
27
|
- ".config/cucumber.yml"
|
24
28
|
- ".gitattributes"
|
25
29
|
- ".gitignore"
|
@@ -33,12 +37,10 @@ files:
|
|
33
37
|
- TODO
|
34
38
|
- Vagrantfile
|
35
39
|
- features/box-command.feature
|
36
|
-
- features/debug-flag.feature
|
37
40
|
- features/env-command.feature
|
38
41
|
- features/help-command.feature
|
39
42
|
- features/openshift.feature
|
40
43
|
- features/service-operation.feature
|
41
|
-
- features/status-command.feature
|
42
44
|
- features/support/env.rb
|
43
45
|
- lib/vagrant-service-manager.rb
|
44
46
|
- lib/vagrant-service-manager/action/setup_network.rb
|
@@ -76,9 +78,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
76
78
|
version: '0'
|
77
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
80
|
requirements:
|
79
|
-
- - "
|
81
|
+
- - ">="
|
80
82
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
83
|
+
version: '0'
|
82
84
|
requirements: []
|
83
85
|
rubyforge_project:
|
84
86
|
rubygems_version: 2.4.8
|
data/features/debug-flag.feature
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
Feature: Command output from --debug flag
|
2
|
-
service-manager should print the debug logs along with native logs
|
3
|
-
|
4
|
-
@status
|
5
|
-
Scenario Outline: Boot and execute simple env command with debug logs
|
6
|
-
Given box is <box>
|
7
|
-
And provider is <provider>
|
8
|
-
And a file named "Vagrantfile" with:
|
9
|
-
"""
|
10
|
-
require 'vagrant-libvirt'
|
11
|
-
|
12
|
-
Vagrant.configure('2') do |config|
|
13
|
-
config.vm.box = '<box>'
|
14
|
-
config.vm.box_url = 'file://../boxes/<box>-<provider>.box'
|
15
|
-
config.vm.network :private_network, ip: '<ip>'
|
16
|
-
config.vm.synced_folder '.', '/vagrant', disabled: true
|
17
|
-
config.servicemanager.services = 'docker'
|
18
|
-
end
|
19
|
-
"""
|
20
|
-
|
21
|
-
When I successfully run `bundle exec vagrant up --provider <provider>`
|
22
|
-
And I successfully run `bundle exec vagrant service-manager env --debug`
|
23
|
-
Then stdout from "bundle exec vagrant service-manager env --debug" should match /DEBUG command: [ service-manager: env ]/
|
24
|
-
|
25
|
-
Examples:
|
26
|
-
| box | provider | ip |
|
27
|
-
| cdk | virtualbox | 10.10.10.42 |
|
28
|
-
| adb | virtualbox | 10.10.10.42 |
|
29
|
-
| cdk | libvirt | 10.10.10.42 |
|
30
|
-
| adb | libvirt | 10.10.10.42 |
|
@@ -1,31 +0,0 @@
|
|
1
|
-
Feature: Command output from status command
|
2
|
-
service-manager should return the correct output from status command
|
3
|
-
|
4
|
-
@status
|
5
|
-
Scenario Outline: Boot and execute status command
|
6
|
-
Given box is <box>
|
7
|
-
And provider is <provider>
|
8
|
-
And a file named "Vagrantfile" with:
|
9
|
-
"""
|
10
|
-
require 'vagrant-libvirt'
|
11
|
-
|
12
|
-
Vagrant.configure('2') do |config|
|
13
|
-
config.vm.box = '<box>'
|
14
|
-
config.vm.box_url = 'file://../boxes/<box>-<provider>.box'
|
15
|
-
config.vm.network :private_network, ip: '<ip>'
|
16
|
-
config.vm.synced_folder '.', '/vagrant', disabled: true
|
17
|
-
config.servicemanager.services = 'docker'
|
18
|
-
end
|
19
|
-
"""
|
20
|
-
|
21
|
-
When I successfully run `bundle exec vagrant up --provider <provider>`
|
22
|
-
And I successfully run `bundle exec vagrant service-manager status`
|
23
|
-
Then stdout from "bundle exec vagrant service-manager status" should contain "docker - running"
|
24
|
-
Then stdout from "bundle exec vagrant service-manager status" should contain "openshift - stopped"
|
25
|
-
|
26
|
-
Examples:
|
27
|
-
| box | provider | ip |
|
28
|
-
| cdk | virtualbox | 10.10.10.42 |
|
29
|
-
| adb | virtualbox | 10.10.10.42 |
|
30
|
-
| cdk | libvirt | 10.10.10.42 |
|
31
|
-
| adb | libvirt | 10.10.10.42 |
|