vagrant-openshift 3.0.8 → 3.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +6 -1
- data/Gemfile +5 -1
- data/README.asciidoc +65 -78
- data/hack/test.sh +135 -0
- data/hack/update.sh +32 -0
- data/lib/vagrant-openshift.rb +1 -0
- data/lib/vagrant-openshift/action.rb +83 -12
- data/lib/vagrant-openshift/action/build_origin_images.rb +2 -2
- data/lib/vagrant-openshift/action/create_yum_repositories.rb +1 -1
- data/lib/vagrant-openshift/action/download_artifacts_origin_console.rb +2 -2
- data/lib/vagrant-openshift/action/download_artifacts_origin_metrics.rb +67 -0
- data/lib/vagrant-openshift/action/install_docker.rb +54 -0
- data/lib/vagrant-openshift/action/install_golang.rb +52 -0
- data/lib/vagrant-openshift/action/install_origin_asset_dependencies.rb +6 -3
- data/lib/vagrant-openshift/action/install_origin_base_dependencies.rb +22 -237
- data/lib/vagrant-openshift/action/install_origin_rhel7.rb +29 -6
- data/lib/vagrant-openshift/action/push_openshift_images.rb +26 -37
- data/lib/vagrant-openshift/action/run_customer_diagnostics_tests.rb +79 -0
- data/lib/vagrant-openshift/action/run_origin_asset_tests.rb +1 -3
- data/lib/vagrant-openshift/action/run_origin_metrics_tests.rb +83 -0
- data/lib/vagrant-openshift/action/run_origin_tests.rb +9 -4
- data/lib/vagrant-openshift/command/checkout_repositories.rb +1 -3
- data/lib/vagrant-openshift/command/create_local_yum_repo.rb +2 -2
- data/lib/vagrant-openshift/command/download_artifacts_origin_metrics.rb +49 -0
- data/lib/vagrant-openshift/command/install_docker.rb +68 -0
- data/lib/vagrant-openshift/command/install_golang.rb +68 -0
- data/lib/vagrant-openshift/command/repo_sync_customer_diagnostics.rb +71 -0
- data/lib/vagrant-openshift/command/repo_sync_origin_metrics.rb +71 -0
- data/lib/vagrant-openshift/command/test_customer_diagnostics.rb +69 -0
- data/lib/vagrant-openshift/command/test_origin_image.rb +1 -1
- data/lib/vagrant-openshift/command/test_origin_metrics.rb +67 -0
- data/lib/vagrant-openshift/constants.rb +8 -2
- data/lib/vagrant-openshift/helper/command_helper.rb +63 -39
- data/lib/vagrant-openshift/helper/install_helper.rb +139 -0
- data/lib/vagrant-openshift/plugin.rb +37 -2
- data/lib/vagrant-openshift/resources/configure_docker.sh +53 -0
- data/lib/vagrant-openshift/resources/configure_system.sh +23 -0
- data/lib/vagrant-openshift/resources/install_chrome.sh +22 -0
- data/lib/vagrant-openshift/resources/install_dependencies.sh +58 -0
- data/lib/vagrant-openshift/resources/install_nonessential.sh +6 -0
- data/lib/vagrant-openshift/resources/install_rhaos_repos.sh +11 -0
- data/lib/vagrant-openshift/resources/reconfigure_network_fedora.sh +13 -0
- data/lib/vagrant-openshift/resources/rhaos31.repo +13 -0
- data/lib/vagrant-openshift/resources/rhaos32.repo +13 -0
- data/lib/vagrant-openshift/resources/rhaos33.repo +13 -0
- data/lib/vagrant-openshift/resources/rhaos34.repo +13 -0
- data/lib/vagrant-openshift/version.rb +1 -1
- metadata +29 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17e68ca9975be343edfb92ff6834f5163b1a3563
|
4
|
+
data.tar.gz: 4f980dc0dfb287f8247fbec5600eab2bd463d6be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c18a6ef845c6dfd0250bc560668de2a55bfbb9e27b9efe23708815b869dff5c49ac82fd54ee654314903e5b035856986ad82d1057b6085d382b185c40638be06
|
7
|
+
data.tar.gz: 0d3ae65ef3f0db3b31d8729980ceccbfe4b65cdb29de296ad89567368d595ea0ac6ab1fd976a3d4c114aa45f4ccb06275b4ef3a51aefb3bd1f5f721368cb61ea
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -10,7 +10,11 @@ group :development do
|
|
10
10
|
if File.exist?(File.expand_path("../../vagrant", __FILE__))
|
11
11
|
gem "vagrant", path: "../vagrant"
|
12
12
|
else
|
13
|
-
|
13
|
+
if Gem::Version.new(Bundler::VERSION) < Gem::Version.new("1.12.5")
|
14
|
+
gem "vagrant", :git => "https://github.com/mitchellh/vagrant", :ref => "v1.7.4"
|
15
|
+
else
|
16
|
+
gem "vagrant", :git => "https://github.com/mitchellh/vagrant"
|
17
|
+
end
|
14
18
|
end
|
15
19
|
gem "json"
|
16
20
|
end
|
data/README.asciidoc
CHANGED
@@ -32,16 +32,19 @@ Like other plugins, this gem will be installed in your `~/.vagrant.d/gems/` dire
|
|
32
32
|
To work on the *vagrant-openshift* plugin, clone this repository and use
|
33
33
|
link:http://gembundler.com[Bundler] to get the dependencies:
|
34
34
|
|
35
|
+
You *MUST* use bundler < = 1.10.5 or bundler = 1.12.5 when building this gem, as it is required by the vagrant gem.
|
36
|
+
|
35
37
|
[source, sh]
|
36
38
|
----
|
37
|
-
$
|
39
|
+
$ gem install bundler -v '1.12.5'
|
40
|
+
$ bundle _1.12.5_
|
38
41
|
----
|
39
42
|
|
40
43
|
Compile using Rake:
|
41
44
|
|
42
45
|
[source, sh]
|
43
46
|
----
|
44
|
-
$ bundle exec rake
|
47
|
+
$ bundle _1.12.5_ exec rake
|
45
48
|
----
|
46
49
|
|
47
50
|
===== From rubygems.org
|
@@ -103,7 +106,7 @@ NOTE: If you are trying to refresh an existing image, you'll want to remove the
|
|
103
106
|
|
104
107
|
[source, sh]
|
105
108
|
----
|
106
|
-
$ vagrant up
|
109
|
+
$ vagrant up --provider=virtualbox
|
107
110
|
----
|
108
111
|
|
109
112
|
NOTE: See link:#other-providers[Other Providers] below for launching VMs from other providers.
|
@@ -140,6 +143,44 @@ To enable easy customization of the build environment, any files placed under `\
|
|
140
143
|
the vagrant user home directory. For example: `~/.openshiftdev/home.d/.bash_profile` will be copied to `.bash_profile`
|
141
144
|
on the vagrant VM.
|
142
145
|
|
146
|
+
==== Configuring Docker and Golang versions for tests
|
147
|
+
|
148
|
+
If the version of OpenShift that is being tested requires a version
|
149
|
+
of Golang or Docker that is not default in the RPM streams for the
|
150
|
+
operating system used for the image, `vagrant-openshift` allows for
|
151
|
+
customization of the image.
|
152
|
+
|
153
|
+
To build a new image with the versions of Golang and Docker necessary,
|
154
|
+
begin with an 'os' stage:
|
155
|
+
[source, sh]
|
156
|
+
----
|
157
|
+
$ vagrant origin-init --stage os --os rhel7 --instance-type c4.xlarge "${instance_name}"
|
158
|
+
----
|
159
|
+
|
160
|
+
Then, you may provide the following information to customize your image:
|
161
|
+
|
162
|
+
* URLs to repositories containing the desired Docker and/or Golang RPMs to use during the install
|
163
|
+
* names of repositores already installed on the OS that you want to use during the install
|
164
|
+
* versions of Golang and/or Docker to install
|
165
|
+
|
166
|
+
Any RPM repositories you add by providing URLs will only be enabled for
|
167
|
+
the duration of the installation. Only the repositories you provide using
|
168
|
+
URLs or those that you name explcitly will be enabled during the install.
|
169
|
+
|
170
|
+
For instance, some installation of OpenShift Origin could want custom
|
171
|
+
Go and Docker versions, both of which must be installed from custom URLs.
|
172
|
+
Furthermore, some of the Docker dependencies may have up-to-date versions
|
173
|
+
in the RHEL streams, so the following commands would be used to configure
|
174
|
+
the image base:
|
175
|
+
[source, sh]
|
176
|
+
----
|
177
|
+
$ vagrant install-golang --golang.repourl=http://some.golang.rpm.repository.com/ \
|
178
|
+
--golang.version=1.6.2
|
179
|
+
|
180
|
+
$ vagrant install-docker --docker.repourl=http://some.docker.rpm.repository.com/ \
|
181
|
+
--docker.repo=oso-rhui-rhel-server-releases \
|
182
|
+
--docker.version=1.10.3
|
183
|
+
----
|
143
184
|
|
144
185
|
=== Other Providers
|
145
186
|
|
@@ -252,106 +293,53 @@ vagrant up --provider=openstack
|
|
252
293
|
NOTE: Requires latest link:https://github.com/cloudbau/vagrant-openstack-plugin[OpenStack] provider.
|
253
294
|
|
254
295
|
|
255
|
-
====
|
296
|
+
==== Libvirt
|
256
297
|
|
257
|
-
*
|
298
|
+
* If using a recent version of Fedora, you can install vagrant-libvirt directly using yum/dnf. Otherwise you will need to follow the `vagrant plugin install` instructions below.
|
258
299
|
|
259
300
|
[source, sh]
|
260
301
|
----
|
261
|
-
yum install
|
302
|
+
sudo yum install vagrant-libvirt
|
262
303
|
----
|
263
304
|
|
264
|
-
* Install the vagrant-libvirt plugin
|
305
|
+
* Install the vagrant-libvirt plugin dependencies (only if `sudo yum install vagrant-libvirt` didn't work)
|
265
306
|
|
266
307
|
[source, sh]
|
267
308
|
----
|
268
|
-
|
309
|
+
sudo yum install libxslt-devel libxml2-devel libvirt-devel ruby-devel rubygems
|
269
310
|
----
|
270
311
|
|
271
|
-
|
272
|
-
link:https://github.com/mitchellh/vagrant/issues/5118[this issue]:
|
312
|
+
* Install the vagrant-libvirt plugin *(only if `sudo yum install vagrant-libvirt` didn't work)*
|
273
313
|
|
314
|
+
[source, sh]
|
274
315
|
----
|
275
|
-
|
316
|
+
vagrant plugin install vagrant-libvirt
|
276
317
|
----
|
277
318
|
|
319
|
+
NOTE: This may require modifying the system linker as described in
|
320
|
+
link:https://github.com/mitchellh/vagrant/issues/5118[this issue]:
|
278
321
|
|
279
|
-
* Configure LibVirt to allow remote TLS connections
|
280
|
-
** Create TLS certificates and key pairs. Follow the guide at http://libvirt.org/remote.html#Remote_certificates
|
281
|
-
Example commands for creating a self signed certificate are provided below.
|
282
|
-
|
283
|
-
.Example self-signed certificates
|
284
|
-
[source, sh]
|
285
322
|
----
|
286
|
-
|
287
|
-
|
288
|
-
#CA Cert
|
289
|
-
certtool --generate-privkey > cakey.pem
|
290
|
-
|
291
|
-
cat <<EOF> ca.info
|
292
|
-
cn = MyOrg
|
293
|
-
ca
|
294
|
-
cert_signing_key
|
295
|
-
EOF
|
296
|
-
|
297
|
-
certtool --generate-self-signed --load-privkey cakey.pem --template ca.info --outfile cacert.pem
|
298
|
-
/bin/cp -f cacert.pem /etc/pki/CA/cacert.pem
|
299
|
-
|
300
|
-
#Server cert
|
301
|
-
certtool --generate-privkey > serverkey.pem
|
302
|
-
|
303
|
-
cat <<EOF> server.info
|
304
|
-
organization = MyOrg
|
305
|
-
cn = oirase
|
306
|
-
tls_www_server
|
307
|
-
encryption_key
|
308
|
-
signing_key
|
309
|
-
EOF
|
310
|
-
|
311
|
-
certtool --generate-certificate --load-privkey serverkey.pem \
|
312
|
-
--load-ca-certificate cacert.pem --load-ca-privkey cakey.pem \
|
313
|
-
--template server.info --outfile servercert.pem
|
314
|
-
/bin/cp -f serverkey.pem /etc/pki/libvirt/private/serverkey.pem
|
315
|
-
/bin/cp -f servercert.pem /etc/pki/libvirt/servercert.pem
|
316
|
-
|
317
|
-
#Client cert
|
318
|
-
certtool --generate-privkey > clientkey.pem
|
319
|
-
|
320
|
-
cat <<EOF> client.info
|
321
|
-
country = US
|
322
|
-
state = California
|
323
|
-
locality = Mountain View
|
324
|
-
organization = MyOrg
|
325
|
-
cn = client1
|
326
|
-
tls_www_client
|
327
|
-
encryption_key
|
328
|
-
signing_key
|
329
|
-
EOF
|
330
|
-
|
331
|
-
certtool --generate-certificate --load-privkey clientkey.pem \
|
332
|
-
--load-ca-certificate cacert.pem --load-ca-privkey cakey.pem \
|
333
|
-
--template client.info --outfile clientcert.pem
|
334
|
-
|
335
|
-
/bin/cp -f clientkey.pem /etc/pki/libvirt/private/clientkey.pem
|
336
|
-
/bin/cp -f clientcert.pem /etc/pki/libvirt/clientcert.pem
|
323
|
+
sudo alternatives --set ld /usr/bin/ld.gold
|
337
324
|
----
|
338
325
|
|
339
|
-
|
326
|
+
* Add your user to the libvirt group - this gives authorization to connect to libvirtd
|
340
327
|
|
328
|
+
[source, sh]
|
341
329
|
----
|
342
|
-
|
330
|
+
sudo usermod -a -G libvirt $USER
|
343
331
|
----
|
344
332
|
|
345
|
-
|
333
|
+
* Log out and log in for the group change to take effect
|
346
334
|
|
347
|
-
* Start the
|
335
|
+
* Start the libvirt machine
|
348
336
|
|
349
337
|
[source, sh]
|
350
338
|
----
|
351
339
|
vagrant up --provider=libvirt
|
352
340
|
----
|
353
341
|
|
354
|
-
NOTE: Requires latest link:https://github.com/pradels/vagrant-libvirt[
|
342
|
+
NOTE: Requires latest link:https://github.com/pradels/vagrant-libvirt[libvirt] provider
|
355
343
|
|
356
344
|
===== Managed
|
357
345
|
|
@@ -420,20 +408,19 @@ $ vagrant build-origin --images
|
|
420
408
|
$ vagrant build-sti --binary-only
|
421
409
|
----
|
422
410
|
|
423
|
-
=== Testing openshift/origin-aggregated-logging
|
411
|
+
=== Testing openshift/origin-aggregated-logging or openshift/origin-metrics
|
424
412
|
|
425
413
|
NOTE: You will still need to clone the OpenShift Origin repo as above, in order
|
426
414
|
to use the Vagrantfile and the contrib/vagrant directory.
|
427
|
-
origin-aggregated-logging currently
|
415
|
+
origin-aggregated-logging and origin-metrics currently have no vagrant support.
|
428
416
|
|
429
|
-
==== Clone the OpenShift Origin aggregated logging repositories
|
417
|
+
==== Clone the OpenShift Origin aggregated logging or metrics repositories
|
430
418
|
|
431
419
|
Use `vagrant origin-local-checkout` as above link:#clone-the-openshift-origin-repositories[Clone the OpenShift Origin repositories], except use `--repo origin-aggregated-logging`:
|
432
420
|
[source, sh]
|
433
421
|
----
|
434
422
|
$ cd $GOPATH
|
435
|
-
$ vagrant origin-local-checkout --repo origin-aggregated-logging -u <github
|
436
|
-
username>
|
423
|
+
$ vagrant origin-local-checkout --repo origin-aggregated-logging -u <github username>
|
437
424
|
# run the remaining vagrant commands from $GOPATH/src/github.com/openshift/origin
|
438
425
|
$ pushd $GOPATH/src/github.com/openshift/origin
|
439
426
|
----
|
data/hack/test.sh
ADDED
@@ -0,0 +1,135 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# This script uses the current state of the repository to build a new vagrant-openshift
|
4
|
+
# gem, install it, and then exercise the CLI of the vagrant-openshfit plugin to test its
|
5
|
+
# functionality. This script honors the following environment variables:
|
6
|
+
# - TEST_VM_NAME: the name to use to identify the VM launched for testing
|
7
|
+
# - TEST_VM_SIZE: the VM size (as the AWS instance name) to use
|
8
|
+
# - SKIP_INSTALL: skips building and installing a new vagrant-openshift gem
|
9
|
+
# - SKIP_CLEANUP: skips cleaning up the VMs created for tests
|
10
|
+
# - CLEANUP_RENAME: cleans up instances by stopping and renaming instead of destroying them
|
11
|
+
# - GOPATH_OVERRIDE: uses a temporary directory for $GOPATH instead of inheriting it from the host
|
12
|
+
# - VERBOSE: always show full command output, even a command succeeded
|
13
|
+
|
14
|
+
set -o errexit
|
15
|
+
set -o nounset
|
16
|
+
set -o pipefail
|
17
|
+
|
18
|
+
function cleanup_instance() {
|
19
|
+
pushd "${OS_ROOT}" >/dev/null 2>&1
|
20
|
+
if [[ -f ".vagrant-openshift.json" ]]; then
|
21
|
+
if [[ -n "${CLEANUP_RENAME:-}" ]]; then
|
22
|
+
vagrant modify-instance --stop --rename 'terminate'
|
23
|
+
else
|
24
|
+
vagrant destroy -f
|
25
|
+
fi
|
26
|
+
else
|
27
|
+
# we were not able to clean up the instance, but the code
|
28
|
+
# below will expect it to be gone and may fail later trying
|
29
|
+
# to re-create it due to a name conflict, so we need to
|
30
|
+
# fail early and loudly
|
31
|
+
echo "[FAILURE] Could not clean up instance, exiting"
|
32
|
+
exit 1
|
33
|
+
fi
|
34
|
+
rm -rf .vagrant
|
35
|
+
popd >/dev/null 2>&1
|
36
|
+
}
|
37
|
+
|
38
|
+
function conditional_cleanup_instance() {
|
39
|
+
if [[ -z "${SKIP_CLEANUP:-}" ]]; then
|
40
|
+
cleanup_instance
|
41
|
+
fi
|
42
|
+
}
|
43
|
+
|
44
|
+
# validate_version validates that the version of the package installed
|
45
|
+
# on the remote VM is equal to the expected version provided
|
46
|
+
function validate_version() {
|
47
|
+
local package=$1
|
48
|
+
local expected_version=$2
|
49
|
+
local actual_version
|
50
|
+
actual_version="$( vagrant ssh -c "rpm -q --queryformat='%{version}' '${package}'" )"
|
51
|
+
if [[ ! "${expected_version}" = "${actual_version}" ]]; then
|
52
|
+
echo "[FAILURE] Expected to find ${package}-${expected_version}, but got ${package}-${actual_version}."
|
53
|
+
return 1
|
54
|
+
fi
|
55
|
+
echo "[SUCCESS] Found ${package}-${actual_version} on the remote machine."
|
56
|
+
}
|
57
|
+
|
58
|
+
# test_vagrant runs a vagrant command and allows us to only show output from failed commands
|
59
|
+
function test_vagrant() {
|
60
|
+
echo "[INFO] Testing \`vagrant $*\`"
|
61
|
+
if ! vagrant "$@" > /tmp/vagrant-openshift-test.log 2>&1; then
|
62
|
+
cat /tmp/vagrant-openshift-test.log
|
63
|
+
echo "[FAILURE] The command \`vagrant $*\` failed!"
|
64
|
+
return 1
|
65
|
+
elif [[ -n "${VERBOSE:-}" ]]; then
|
66
|
+
cat /tmp/vagrant-openshift-test.log
|
67
|
+
fi
|
68
|
+
echo "[SUCCESS] The command \`vagrant $*\` succeeded!"
|
69
|
+
}
|
70
|
+
|
71
|
+
# First, build the new vagrant-openshift gem and install the plugin on the host
|
72
|
+
VOS_ROOT="$( cd "$( dirname "${BASH_SOURCE}" )/.."; pwd )"
|
73
|
+
pushd "${VOS_ROOT}" >/dev/null 2>&1
|
74
|
+
if [[ -z "${SKIP_INSTALL:-}" ]]; then
|
75
|
+
echo "[INFO] Building new vagrant-openshift gem and installing plugin"
|
76
|
+
hack/update.sh
|
77
|
+
vagrant plugin install vagrant-aws
|
78
|
+
fi
|
79
|
+
popd >/dev/null 2>&1
|
80
|
+
|
81
|
+
OS_ROOT="./origin"
|
82
|
+
if [[ -n "${GOPATH_OVERRIDE:-}" ]]; then
|
83
|
+
export GOPATH="${GOPATH_OVERRIDE}"
|
84
|
+
mkdir -p "${GOPATH}"
|
85
|
+
OS_ROOT="${GOPATH}/src/github.com/openshift/origin"
|
86
|
+
fi
|
87
|
+
|
88
|
+
test_vagrant origin-local-checkout --replace
|
89
|
+
|
90
|
+
# Next, create a VM and run our tests in it
|
91
|
+
pushd "${OS_ROOT}" >/dev/null 2>&1
|
92
|
+
test_vagrant origin-init --stage="os" \
|
93
|
+
--os="rhel7" \
|
94
|
+
--instance-type="${TEST_VM_SIZE:-m4.large}" \
|
95
|
+
"${TEST_VM_NAME:-vagrant-openshift-tests}"
|
96
|
+
|
97
|
+
for _ in $(seq 0 2) ; do
|
98
|
+
if vagrant up --provider aws; then
|
99
|
+
break
|
100
|
+
fi
|
101
|
+
|
102
|
+
echo "[WARNING] \`vagrant up\` failed - retrying"
|
103
|
+
cleanup_instance
|
104
|
+
done
|
105
|
+
|
106
|
+
# We want to make sure we clean up after ourselves if this script exits unexpectedly
|
107
|
+
trap conditional_cleanup_instance EXIT
|
108
|
+
|
109
|
+
# The following steps ensure that we can build the `deps` image from the `os` base
|
110
|
+
test_vagrant build-origin-base
|
111
|
+
|
112
|
+
# Install Docker and Golang at specific versions
|
113
|
+
test_vagrant install-golang --golang.version=1.6.3 \
|
114
|
+
--repo=oso-rhui-rhel-server-releases-optional
|
115
|
+
validate_version 'golang' '1.6.3'
|
116
|
+
|
117
|
+
docker_repo='https://mirror.openshift.com/enterprise/rhel/dockerextra/x86_64/os/'
|
118
|
+
test_vagrant install-docker --docker.version=1.12.2 \
|
119
|
+
--repourl="${docker_repo}" \
|
120
|
+
--repo=oso-rhui-rhel-server-releases \
|
121
|
+
--repo=oso-rhui-rhel-server-releases-optional
|
122
|
+
validate_version 'docker' '1.12.2'
|
123
|
+
|
124
|
+
test_vagrant clone-upstream-repos --clean
|
125
|
+
test_vagrant checkout-repos
|
126
|
+
test_vagrant build-origin-base-images
|
127
|
+
test_vagrant install-origin-assets-base
|
128
|
+
|
129
|
+
test_vagrant install-origin
|
130
|
+
test_vagrant build-origin --images
|
131
|
+
test_vagrant build-sti --binary-only
|
132
|
+
|
133
|
+
popd >/dev/null 2>&1
|
134
|
+
|
135
|
+
echo "[SUCCESS] vagrant-openshift tests successful"
|
data/hack/update.sh
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# This script will attempt to build the vagrant-openshift gem
|
4
|
+
# from the current source tree and install it locally in the
|
5
|
+
# vagrant plugin environment.
|
6
|
+
|
7
|
+
set -o errexit
|
8
|
+
set -o nounset
|
9
|
+
set -o pipefail
|
10
|
+
|
11
|
+
VAGRANT_OPENSHIFT_ROOT="$( cd "$( dirname "${BASH_SOURCE}" )/.."; pwd )"
|
12
|
+
pushd "${VAGRANT_OPENSHIFT_ROOT}" >/dev/null 2>&1
|
13
|
+
|
14
|
+
if ! git diff-index --quiet HEAD; then
|
15
|
+
echo "[WARNING] Uncommited changes exist either in stage or in the working tree."
|
16
|
+
echo "[WARNING] Commit them to proceed in building the plugin."
|
17
|
+
exit 1
|
18
|
+
fi
|
19
|
+
|
20
|
+
echo "[INFO] Building vagrant-openshift gem using bundler..."
|
21
|
+
{
|
22
|
+
bundle
|
23
|
+
bundle install
|
24
|
+
bundle exec rake
|
25
|
+
} >/tmp/vagrant-origin-update.log 2>&1
|
26
|
+
echo "[INFO] Full build and install logs placed at /tmp/vagrant-openshift-update.log"
|
27
|
+
|
28
|
+
vagrant plugin install pkg/vagrant-openshift-*.gem
|
29
|
+
|
30
|
+
popd >/dev/null 2>&1
|
31
|
+
|
32
|
+
echo "[INFO] Successfully built and installed vagrant-openshift plugin"
|
data/lib/vagrant-openshift.rb
CHANGED
@@ -27,6 +27,7 @@ module Vagrant
|
|
27
27
|
plugin_path = Pathname.new(File.expand_path("#{__FILE__}/../vagrant-openshift/"))
|
28
28
|
|
29
29
|
autoload :CommandHelper, plugin_path + "helper/command_helper"
|
30
|
+
autoload :InstallHelper, plugin_path + "helper/install_helper"
|
30
31
|
autoload :Constants, plugin_path + "constants"
|
31
32
|
end
|
32
33
|
end
|
@@ -54,9 +54,20 @@ module Vagrant
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
+
def self.install_docker(options)
|
58
|
+
Vagrant::Action::Builder.new.tap do |b|
|
59
|
+
b.use InstallDocker, options
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.install_golang(options)
|
64
|
+
Vagrant::Action::Builder.new.tap do |b|
|
65
|
+
b.use InstallGolang, options
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
57
69
|
def self.install_origin(options)
|
58
70
|
Vagrant::Action::Builder.new.tap do |b|
|
59
|
-
b.use YumUpdate
|
60
71
|
b.use SetHostName
|
61
72
|
b.use InstallOrigin
|
62
73
|
b.use InstallOriginRhel7
|
@@ -135,7 +146,7 @@ module Vagrant
|
|
135
146
|
end
|
136
147
|
end
|
137
148
|
end
|
138
|
-
|
149
|
+
|
139
150
|
def self.repo_sync_origin_console(options)
|
140
151
|
Vagrant::Action::Builder.new.tap do |b|
|
141
152
|
b.use PrepareSshConfig
|
@@ -146,12 +157,12 @@ module Vagrant
|
|
146
157
|
end
|
147
158
|
b.use SyncLocalRepository, :repo => 'origin-console'
|
148
159
|
b.use CheckoutRepositories, :repo => 'origin-console'
|
149
|
-
if options[:build]
|
160
|
+
if options[:build]
|
150
161
|
b.use InstallOriginAssetDependencies, :restore_assets => true
|
151
|
-
end
|
162
|
+
end
|
152
163
|
end
|
153
164
|
end
|
154
|
-
end
|
165
|
+
end
|
155
166
|
|
156
167
|
def self.repo_sync_origin_aggregated_logging(options)
|
157
168
|
Vagrant::Action::Builder.new.tap do |b|
|
@@ -173,6 +184,34 @@ module Vagrant
|
|
173
184
|
end
|
174
185
|
end
|
175
186
|
|
187
|
+
def self.repo_sync_origin_metrics(options)
|
188
|
+
Vagrant::Action::Builder.new.tap do |b|
|
189
|
+
b.use PrepareSshConfig
|
190
|
+
if options[:source]
|
191
|
+
if options[:clean]
|
192
|
+
b.use Clean, options
|
193
|
+
b.use CloneUpstreamRepositories, options
|
194
|
+
end
|
195
|
+
b.use SyncLocalRepository, options
|
196
|
+
b.use CheckoutRepositories, options
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
def self.repo_sync_customer_diagnostics(options)
|
202
|
+
Vagrant::Action::Builder.new.tap do |b|
|
203
|
+
b.use PrepareSshConfig
|
204
|
+
if options[:source]
|
205
|
+
if options[:clean]
|
206
|
+
b.use Clean, options
|
207
|
+
b.use CloneUpstreamRepositories, options
|
208
|
+
end
|
209
|
+
b.use SyncLocalRepository, options
|
210
|
+
b.use CheckoutRepositories, options
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
176
215
|
def self.local_origin_checkout(options)
|
177
216
|
Vagrant::Action::Builder.new.tap do |b|
|
178
217
|
if not options[:no_build]
|
@@ -190,18 +229,18 @@ module Vagrant
|
|
190
229
|
b.use TestExitCode
|
191
230
|
end
|
192
231
|
end
|
193
|
-
|
232
|
+
|
194
233
|
def self.run_origin_asset_tests(options)
|
195
234
|
Vagrant::Action::Builder.new.tap do |b|
|
196
235
|
# UI integration tests require the api server to be running
|
197
|
-
b.use RunSystemctl, {:action => "start", :service => "openshift"}
|
236
|
+
b.use RunSystemctl, {:action => "start", :service => "openshift"}
|
198
237
|
b.use RunOriginAssetTests, options
|
199
238
|
if options[:download]
|
200
239
|
b.use DownloadArtifactsOriginConsole
|
201
240
|
end
|
202
241
|
b.use TestExitCode
|
203
242
|
end
|
204
|
-
end
|
243
|
+
end
|
205
244
|
|
206
245
|
def self.run_origin_aggregated_logging_tests(options)
|
207
246
|
Vagrant::Action::Builder.new.tap do |b|
|
@@ -213,6 +252,27 @@ module Vagrant
|
|
213
252
|
end
|
214
253
|
end
|
215
254
|
|
255
|
+
def self.run_origin_metrics_tests(options)
|
256
|
+
Vagrant::Action::Builder.new.tap do |b|
|
257
|
+
b.use RunOriginMetricsTests, options
|
258
|
+
if options[:download]
|
259
|
+
b.use DownloadArtifactsOriginMetrics
|
260
|
+
end
|
261
|
+
b.use TestExitCode
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
def self.run_customer_diagnostics_tests(options)
|
266
|
+
Vagrant::Action::Builder.new.tap do |b|
|
267
|
+
b.use RunCustomerDiagnosticsTests, options
|
268
|
+
if options[:download]
|
269
|
+
b.use DownloadArtifactsOriginMetrics
|
270
|
+
end
|
271
|
+
b.use TestExitCode
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
|
216
276
|
def self.run_sti_tests(options)
|
217
277
|
Vagrant::Action::Builder.new.tap do |b|
|
218
278
|
b.use RunStiTests, options
|
@@ -240,12 +300,18 @@ module Vagrant
|
|
240
300
|
b.use DownloadArtifactsOriginAggregatedLogging
|
241
301
|
end
|
242
302
|
end
|
243
|
-
|
303
|
+
|
304
|
+
def self.download_origin_metrics_artifacts(options)
|
305
|
+
Vagrant::Action::Builder.new.tap do |b|
|
306
|
+
b.use DownloadArtifactsOriginMetrics
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
244
310
|
def self.download_origin_console_artifacts(options)
|
245
311
|
Vagrant::Action::Builder.new.tap do |b|
|
246
312
|
b.use DownloadArtifactsOriginConsole
|
247
313
|
end
|
248
|
-
end
|
314
|
+
end
|
249
315
|
|
250
316
|
def self.gen_template(options)
|
251
317
|
Vagrant::Action::Builder.new.tap do |b|
|
@@ -310,6 +376,8 @@ module Vagrant
|
|
310
376
|
autoload :SetHostName, action_root.join("set_host_name")
|
311
377
|
autoload :YumUpdate, action_root.join("yum_update")
|
312
378
|
autoload :InstallOriginBaseDependencies, action_root.join("install_origin_base_dependencies")
|
379
|
+
autoload :InstallDocker, action_root.join("install_docker")
|
380
|
+
autoload :InstallGolang, action_root.join("install_golang")
|
313
381
|
autoload :InstallOriginAssetDependencies, action_root.join("install_origin_asset_dependencies")
|
314
382
|
autoload :BuildOriginBaseImages, action_root.join("build_origin_base_images")
|
315
383
|
autoload :PushOpenshiftImages, action_root.join("push_openshift_images")
|
@@ -324,17 +392,20 @@ module Vagrant
|
|
324
392
|
autoload :LocalOriginCheckout, action_root.join("local_origin_checkout")
|
325
393
|
autoload :CreateBareRepoPlaceholders, action_root.join("create_bare_repo_placeholders")
|
326
394
|
autoload :RunOriginTests, action_root.join("run_origin_tests")
|
327
|
-
autoload :RunOriginAssetTests, action_root.join("run_origin_asset_tests")
|
395
|
+
autoload :RunOriginAssetTests, action_root.join("run_origin_asset_tests")
|
328
396
|
autoload :RunStiTests, action_root.join("run_sti_tests")
|
329
397
|
autoload :RunOriginAggregatedLoggingTests, action_root.join("run_origin_aggregated_logging_tests")
|
398
|
+
autoload :RunOriginMetricsTests, action_root.join("run_origin_metrics_tests")
|
399
|
+
autoload :RunCustomerDiagnosticsTests, action_root.join("run_customer_diagnostics_tests")
|
330
400
|
autoload :GenerateTemplate, action_root.join("generate_template")
|
331
401
|
autoload :CreateAMI, action_root.join("create_ami")
|
332
402
|
autoload :ModifyInstance, action_root.join("modify_instance")
|
333
403
|
autoload :ModifyAMI, action_root.join("modify_ami")
|
334
404
|
autoload :DownloadArtifactsOrigin, action_root.join("download_artifacts_origin")
|
335
|
-
autoload :DownloadArtifactsOriginConsole, action_root.join("download_artifacts_origin_console")
|
405
|
+
autoload :DownloadArtifactsOriginConsole, action_root.join("download_artifacts_origin_console")
|
336
406
|
autoload :DownloadArtifactsSti, action_root.join("download_artifacts_sti")
|
337
407
|
autoload :DownloadArtifactsOriginAggregatedLogging, action_root.join("download_artifacts_origin_aggregated_logging")
|
408
|
+
autoload :DownloadArtifactsOriginMetrics, action_root.join("download_artifacts_origin_metrics")
|
338
409
|
autoload :TestExitCode, action_root.join("test_exit_code")
|
339
410
|
autoload :CleanNetworkSetup, action_root.join("clean_network_setup")
|
340
411
|
autoload :RunSystemctl, action_root.join("run_systemctl")
|