vagrant-openshift 1.0.12 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.asciidoc +5 -3
- data/lib/vagrant-openshift/action/build_openshift3.rb +30 -5
- data/lib/vagrant-openshift/action/{install_rhc.rb → build_openshift3_base_images.rb} +13 -11
- data/lib/vagrant-openshift/action/{run_openshift2_tests.rb → build_sti.rb} +28 -11
- data/lib/vagrant-openshift/action/clean.rb +1 -4
- data/lib/vagrant-openshift/action/clean_network_setup.rb +1 -1
- data/lib/vagrant-openshift/action/download_artifacts_openshift3.rb +4 -1
- data/lib/vagrant-openshift/action/{download_artifacts_openshift2.rb → download_artifacts_sti.rb} +3 -11
- data/lib/vagrant-openshift/action/generate_template.rb +38 -40
- data/lib/vagrant-openshift/action/install_openshift3.rb +5 -16
- data/lib/vagrant-openshift/action/{build_openshift2.rb → install_openshift3_asset_dependencies.rb} +17 -5
- data/lib/vagrant-openshift/action/install_openshift3_base_dependencies.rb +20 -5
- data/lib/vagrant-openshift/action/{local_openshift2_checkout.rb → push_openshift3_release.rb} +14 -14
- data/lib/vagrant-openshift/action/run_openshift3_tests.rb +38 -14
- data/lib/vagrant-openshift/action/run_sti_tests.rb +64 -0
- data/lib/vagrant-openshift/action.rb +44 -83
- data/lib/vagrant-openshift/command/build_openshift3.rb +9 -0
- data/lib/vagrant-openshift/command/{build_openshift2_base.rb → build_openshift3_base_images.rb} +5 -5
- data/lib/vagrant-openshift/command/{build_openshift3_infrastructure_images.rb → build_sti.rb} +10 -12
- data/lib/vagrant-openshift/command/checkout_repositories.rb +1 -1
- data/lib/vagrant-openshift/command/{install_rhc.rb → install_openshift3_assets_base.rb} +5 -5
- data/lib/vagrant-openshift/command/local_openshift3_setup.rb +1 -1
- data/lib/vagrant-openshift/command/openshift_init.rb +4 -4
- data/lib/vagrant-openshift/command/push_openshift3_release.rb +57 -0
- data/lib/vagrant-openshift/command/repo_sync_openshift3.rb +1 -13
- data/lib/vagrant-openshift/command/{repo_sync_openshift2.rb → repo_sync_sti.rb} +11 -19
- data/lib/vagrant-openshift/command/test_openshift3.rb +8 -0
- data/lib/vagrant-openshift/command/test_openshift3_image.rb +8 -17
- data/lib/vagrant-openshift/command/test_sti.rb +59 -0
- data/lib/vagrant-openshift/config.rb +2 -14
- data/lib/vagrant-openshift/constants.rb +3 -67
- data/lib/vagrant-openshift/helper/command_helper.rb +0 -3
- data/lib/vagrant-openshift/plugin.rb +24 -29
- data/lib/vagrant-openshift/provisioner.rb +5 -37
- data/lib/vagrant-openshift/templates/builder/Rakefile +0 -205
- data/lib/vagrant-openshift/templates/command/init-openshift/box_info.yaml +34 -49
- data/lib/vagrant-openshift/version.rb +1 -1
- metadata +33 -48
- data/lib/vagrant-openshift/action/build_openshift3_images.rb +0 -54
- data/lib/vagrant-openshift/action/build_openshift3_infrastructure_images.rb +0 -50
- data/lib/vagrant-openshift/action/checkout_openshift2_tests.rb +0 -57
- data/lib/vagrant-openshift/action/create_openshift2_puppet_file.rb +0 -84
- data/lib/vagrant-openshift/action/create_openshift2_test_users.rb +0 -36
- data/lib/vagrant-openshift/action/idle_all_gears_openshift2.rb +0 -36
- data/lib/vagrant-openshift/action/install_openshift2_base_dependencies.rb +0 -50
- data/lib/vagrant-openshift/action/install_openshift2_build_dependencies.rb +0 -48
- data/lib/vagrant-openshift/action/preserve_mcollective_logs.rb +0 -48
- data/lib/vagrant-openshift/action/setup_builder_files.rb +0 -57
- data/lib/vagrant-openshift/action/uninstall_openshift2_rpms.rb +0 -37
- data/lib/vagrant-openshift/command/build_openshift3_images.rb +0 -68
- data/lib/vagrant-openshift/command/local_openshift2_setup.rb +0 -62
- data/lib/vagrant-openshift/command/test_openshift2.rb +0 -108
- data/lib/vagrant-openshift/templates/builder/lib/rpm.rb +0 -248
- data/lib/vagrant-openshift/templates/builder/lib/test.rb +0 -432
- data/lib/vagrant-openshift/templates/builder/yum-listbuilddep +0 -124
- data/lib/vagrant-openshift/templates/command/init-openshift/Vagrantfile.erb +0 -171
@@ -0,0 +1,64 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright 2013 Red Hat, Inc.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#++
|
16
|
+
|
17
|
+
module Vagrant
|
18
|
+
module Openshift
|
19
|
+
module Action
|
20
|
+
class RunStiTests
|
21
|
+
include CommandHelper
|
22
|
+
|
23
|
+
@@SSH_TIMEOUT = 4800
|
24
|
+
|
25
|
+
def initialize(app, env, options)
|
26
|
+
@app = app
|
27
|
+
@env = env
|
28
|
+
@options = options.clone
|
29
|
+
end
|
30
|
+
|
31
|
+
def call(env)
|
32
|
+
@options.delete :logs
|
33
|
+
|
34
|
+
cmds = ['hack/test-go.sh']
|
35
|
+
|
36
|
+
if @options[:all]
|
37
|
+
cmds << 'STI_TIMEOUT="--timeout 240s" hack/test-integration.sh'
|
38
|
+
end
|
39
|
+
|
40
|
+
tests = ''
|
41
|
+
cmds.each do |cmd|
|
42
|
+
tests += "
|
43
|
+
echo '***************************************************'
|
44
|
+
echo 'Running #{cmd}...'
|
45
|
+
time #{cmd}
|
46
|
+
echo 'Finished #{cmd}'
|
47
|
+
echo '***************************************************'
|
48
|
+
"
|
49
|
+
end
|
50
|
+
|
51
|
+
_,_,env[:test_exit_code] = sudo(env[:machine], %{
|
52
|
+
set -e
|
53
|
+
pushd #{Constants.build_dir}/source-to-image >/dev/null
|
54
|
+
export PATH=$GOPATH/bin:$PATH
|
55
|
+
#{tests}
|
56
|
+
popd >/dev/null
|
57
|
+
}, {:timeout => 60*60, :fail_on_error => false, :verbose => false})
|
58
|
+
|
59
|
+
@app.call(env)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -21,96 +21,76 @@ module Vagrant
|
|
21
21
|
module Action
|
22
22
|
include Vagrant::Action::Builtin
|
23
23
|
|
24
|
-
def self.
|
24
|
+
def self.build_openshift3_base(options)
|
25
25
|
Vagrant::Action::Builder.new.tap do |b|
|
26
26
|
b.use CreateYumRepositories
|
27
27
|
b.use YumUpdate
|
28
|
-
b.use InstallOpenshift2BuildDependencies
|
29
|
-
b.use SetupBuilderFiles
|
30
|
-
b.use Clean
|
31
|
-
b.use CloneUpstreamRepositories
|
32
28
|
b.use SetHostName
|
33
|
-
b.use
|
34
|
-
b.use CheckoutRepositories
|
35
|
-
b.use InstallOpenshift2BaseDependencies
|
36
|
-
b.use CreateOpenshift2PuppetFile
|
29
|
+
b.use InstallOpenshift3BaseDependencies
|
37
30
|
end
|
38
31
|
end
|
39
32
|
|
40
|
-
def self.
|
33
|
+
def self.install_openshift3(options)
|
41
34
|
Vagrant::Action::Builder.new.tap do |b|
|
42
35
|
b.use CreateYumRepositories
|
43
36
|
b.use YumUpdate
|
44
|
-
b.use InstallOpenshift3BaseDependencies
|
45
|
-
b.use InstallOpenshift3Images
|
46
37
|
b.use SetHostName
|
38
|
+
b.use InstallOpenshift3
|
39
|
+
b.use InstallOpenshift3AssetDependencies
|
47
40
|
end
|
48
41
|
end
|
49
42
|
|
50
|
-
def self.
|
43
|
+
def self.install_openshift3_assets_base(options)
|
51
44
|
Vagrant::Action::Builder.new.tap do |b|
|
52
|
-
b.use
|
53
|
-
b.use YumUpdate
|
54
|
-
b.use SetHostName
|
55
|
-
b.use InstallOpenshift3
|
56
|
-
b.use BuildOpenshift3
|
45
|
+
b.use InstallOpenshift3AssetDependencies
|
57
46
|
end
|
58
47
|
end
|
59
48
|
|
60
49
|
def self.build_openshift3(options)
|
61
50
|
Vagrant::Action::Builder.new.tap do |b|
|
62
|
-
b.use BuildOpenshift3
|
51
|
+
b.use BuildOpenshift3, options
|
63
52
|
end
|
64
53
|
end
|
65
54
|
|
66
|
-
def self.
|
55
|
+
def self.build_sti(options)
|
67
56
|
Vagrant::Action::Builder.new.tap do |b|
|
68
|
-
b.use
|
57
|
+
b.use BuildSti, options
|
69
58
|
end
|
70
59
|
end
|
71
60
|
|
72
|
-
def self.
|
61
|
+
def self.try_restart_openshift3(options)
|
73
62
|
Vagrant::Action::Builder.new.tap do |b|
|
74
|
-
b.use
|
63
|
+
b.use TryRestartOpenshift3
|
75
64
|
end
|
76
65
|
end
|
77
66
|
|
78
|
-
def self.
|
67
|
+
def self.build_openshift3_base_images(options)
|
79
68
|
Vagrant::Action::Builder.new.tap do |b|
|
80
|
-
b.use
|
69
|
+
b.use BuildOpenshift3BaseImages, options
|
81
70
|
end
|
82
71
|
end
|
83
72
|
|
84
|
-
def self.
|
73
|
+
def self.repo_sync_openshift3(options)
|
85
74
|
Vagrant::Action::Builder.new.tap do |b|
|
86
75
|
b.use PrepareSshConfig
|
87
|
-
if options[:
|
88
|
-
|
89
|
-
|
90
|
-
b.use CreateOpenshift2PuppetFile
|
91
|
-
if options[:local_source]
|
92
|
-
b.use CreateBareRepoPlaceholders
|
93
|
-
else
|
76
|
+
if options[:source]
|
77
|
+
if options[:clean]
|
78
|
+
b.use Clean
|
94
79
|
b.use CloneUpstreamRepositories
|
95
80
|
end
|
96
|
-
end
|
97
|
-
|
98
|
-
if options[:local_source]
|
99
81
|
b.use SyncLocalRepository
|
100
|
-
|
101
|
-
b.use
|
82
|
+
b.use CheckoutRepositories
|
83
|
+
b.use InstallOpenshift3AssetDependencies
|
102
84
|
end
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
if options[:download]
|
108
|
-
b.use DownloadArtifactsOpenshift2
|
85
|
+
unless options[:no_build]
|
86
|
+
b.use(BuildOpenshift3BaseImages, options) if options[:images]
|
87
|
+
b.use(BuildOpenshift3, options)
|
88
|
+
b.use(TryRestartOpenshift3)
|
109
89
|
end
|
110
90
|
end
|
111
91
|
end
|
112
92
|
|
113
|
-
def self.
|
93
|
+
def self.repo_sync_sti(options)
|
114
94
|
Vagrant::Action::Builder.new.tap do |b|
|
115
95
|
b.use PrepareSshConfig
|
116
96
|
if options[:source]
|
@@ -122,17 +102,7 @@ module Vagrant
|
|
122
102
|
b.use CheckoutRepositories
|
123
103
|
end
|
124
104
|
unless options[:no_build]
|
125
|
-
b.use
|
126
|
-
b.use TryRestartOpenshift3 if options[:include].include? Vagrant::Openshift::Constants::FILTER_ORIGIN
|
127
|
-
b.use BuildOpenshift3Images, options if options[:include].include? Vagrant::Openshift::Constants::FILTER_IMAGES
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
def self.local_openshift2_checkout(options)
|
133
|
-
Vagrant::Action::Builder.new.tap do |b|
|
134
|
-
if not options[:no_build]
|
135
|
-
b.use LocalOpenshift2Checkout, options
|
105
|
+
b.use(BuildSti, options)
|
136
106
|
end
|
137
107
|
end
|
138
108
|
end
|
@@ -145,25 +115,21 @@ module Vagrant
|
|
145
115
|
end
|
146
116
|
end
|
147
117
|
|
148
|
-
def self.
|
118
|
+
def self.run_openshift3_tests(options)
|
149
119
|
Vagrant::Action::Builder.new.tap do |b|
|
150
|
-
b.use
|
151
|
-
b.use PreserveMcollectiveLogs
|
152
|
-
b.use IdleAllGearsOpenshift2
|
153
|
-
b.use CheckoutOpenshift2Tests
|
154
|
-
b.use RunOpenshift2Tests, options
|
120
|
+
b.use RunOpenshift3Tests, options
|
155
121
|
if options[:download]
|
156
|
-
b.use
|
122
|
+
b.use DownloadArtifactsOpenshift3
|
157
123
|
end
|
158
124
|
b.use TestExitCode
|
159
125
|
end
|
160
126
|
end
|
161
127
|
|
162
|
-
def self.
|
128
|
+
def self.run_sti_tests(options)
|
163
129
|
Vagrant::Action::Builder.new.tap do |b|
|
164
|
-
b.use
|
130
|
+
b.use RunStiTests, options
|
165
131
|
if options[:download]
|
166
|
-
b.use
|
132
|
+
b.use DownloadArtifactsSti
|
167
133
|
end
|
168
134
|
b.use TestExitCode
|
169
135
|
end
|
@@ -200,6 +166,12 @@ module Vagrant
|
|
200
166
|
end
|
201
167
|
end
|
202
168
|
|
169
|
+
def self.push_openshift3_release(options)
|
170
|
+
Vagrant::Action::Builder.new.tap do |b|
|
171
|
+
b.use PushOpenshift3Release, options
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
203
175
|
def self.clone_upstream_repositories(options)
|
204
176
|
Vagrant::Action::Builder.new.tap do |b|
|
205
177
|
b.use CloneUpstreamRepositories, options
|
@@ -220,46 +192,35 @@ module Vagrant
|
|
220
192
|
|
221
193
|
action_root = Pathname.new(File.expand_path("../action", __FILE__))
|
222
194
|
autoload :Clean, action_root.join("clean")
|
223
|
-
autoload :UninstallOpenshift2Rpms, action_root.join("uninstall_openshift2_rpms")
|
224
195
|
autoload :CloneUpstreamRepositories, action_root.join("clone_upstream_repositories")
|
225
196
|
autoload :CreateYumRepositories, action_root.join("create_yum_repositories")
|
226
|
-
autoload :CreateOpenshift2PuppetFile, action_root.join("create_openshift2_puppet_file")
|
227
|
-
autoload :InstallOpenshift2BaseDependencies, action_root.join("install_openshift2_base_dependencies")
|
228
197
|
autoload :CheckoutRepositories, action_root.join("checkout_repositories")
|
229
198
|
autoload :SetupBindDnsKey, action_root.join("setup_bind_dns_key")
|
230
199
|
autoload :SetHostName, action_root.join("set_host_name")
|
231
200
|
autoload :YumUpdate, action_root.join("yum_update")
|
232
|
-
autoload :SetupBuilderFiles, action_root.join("setup_builder_files")
|
233
|
-
autoload :InstallOpenshift2BuildDependencies, action_root.join("install_openshift2_build_dependencies")
|
234
|
-
autoload :BuildOpenshift3Images, action_root.join("build_openshift3_images")
|
235
|
-
autoload :BuildOpenshift3InfrastructureImages, action_root.join("build_openshift3_infrastructure_images")
|
236
201
|
autoload :InstallOpenshift3BaseDependencies, action_root.join("install_openshift3_base_dependencies")
|
237
|
-
autoload :
|
202
|
+
autoload :InstallOpenshift3AssetDependencies, action_root.join("install_openshift3_asset_dependencies")
|
203
|
+
autoload :BuildOpenshift3BaseImages, action_root.join("build_openshift3_base_images")
|
204
|
+
autoload :PushOpenshift3Release, action_root.join("push_openshift3_release")
|
238
205
|
autoload :InstallOpenshift3, action_root.join("install_openshift3")
|
239
206
|
autoload :BuildOpenshift3, action_root.join("build_openshift3")
|
207
|
+
autoload :BuildSti, action_root.join("build_sti")
|
240
208
|
autoload :TryRestartOpenshift3, action_root.join("try_restart_openshift3")
|
241
209
|
autoload :PrepareSshConfig, action_root.join("prepare_ssh_config")
|
242
210
|
autoload :SyncLocalRepository, action_root.join("sync_local_repository")
|
243
211
|
autoload :SyncUpstreamRepository, action_root.join("sync_upstream_repository")
|
244
|
-
autoload :BuildOpenshift2, action_root.join("build_openshift2")
|
245
|
-
autoload :LocalOpenshift2Checkout, action_root.join("local_openshift2_checkout")
|
246
212
|
autoload :LocalOpenshift3Checkout, action_root.join("local_openshift3_checkout")
|
247
213
|
autoload :CreateBareRepoPlaceholders, action_root.join("create_bare_repo_placeholders")
|
248
|
-
autoload :CreateOpenshift2TestUsers, action_root.join("create_openshift2_test_users")
|
249
|
-
autoload :IdleAllGearsOpenshift2, action_root.join("idle_all_gears_openshift2")
|
250
|
-
autoload :PreserveMcollectiveLogs, action_root.join("preserve_mcollective_logs")
|
251
|
-
autoload :RunOpenshift2Tests, action_root.join("run_openshift2_tests")
|
252
214
|
autoload :RunOpenshift3Tests, action_root.join("run_openshift3_tests")
|
253
|
-
autoload :
|
215
|
+
autoload :RunStiTests, action_root.join("run_sti_tests")
|
254
216
|
autoload :GenerateTemplate, action_root.join("generate_template")
|
255
217
|
autoload :CreateAMI, action_root.join("create_ami")
|
256
218
|
autoload :ModifyInstance, action_root.join("modify_instance")
|
257
219
|
autoload :ModifyAMI, action_root.join("modify_ami")
|
258
|
-
autoload :DownloadArtifactsOpenshift2, action_root.join("download_artifacts_openshift2")
|
259
220
|
autoload :DownloadArtifactsOpenshift3, action_root.join("download_artifacts_openshift3")
|
221
|
+
autoload :DownloadArtifactsSti, action_root.join("download_artifacts_sti")
|
260
222
|
autoload :TestExitCode, action_root.join("test_exit_code")
|
261
223
|
autoload :CleanNetworkSetup, action_root.join("clean_network_setup")
|
262
|
-
autoload :InstallRhc, action_root.join("install_rhc")
|
263
224
|
autoload :SetupBindHost, action_root.join("setup_bind_host")
|
264
225
|
end
|
265
226
|
end
|
@@ -29,10 +29,19 @@ module Vagrant
|
|
29
29
|
options = {}
|
30
30
|
options[:clean] = false
|
31
31
|
options[:local_source] = false
|
32
|
+
options[:images] = false
|
33
|
+
options[:force] = false
|
32
34
|
|
33
35
|
opts = OptionParser.new do |o|
|
34
36
|
o.banner = "Usage: vagrant build-openshift3 [vm-name]"
|
35
37
|
o.separator ""
|
38
|
+
|
39
|
+
o.on("--images", "Build the images as well as core content.") do |c|
|
40
|
+
options[:images] = true
|
41
|
+
end
|
42
|
+
o.on("--force", "Build regardless of whether there have been changes.") do |c|
|
43
|
+
options[:force] = true
|
44
|
+
end
|
36
45
|
end
|
37
46
|
|
38
47
|
# Parse the options
|
data/lib/vagrant-openshift/command/{build_openshift2_base.rb → build_openshift3_base_images.rb}
RENAMED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright
|
2
|
+
# Copyright 2014 Red Hat, Inc.
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -18,11 +18,11 @@ require_relative "../action"
|
|
18
18
|
module Vagrant
|
19
19
|
module Openshift
|
20
20
|
module Commands
|
21
|
-
class
|
21
|
+
class BuildOpenshift3BaseImages < Vagrant.plugin(2, :command)
|
22
22
|
include CommandHelper
|
23
23
|
|
24
24
|
def self.synopsis
|
25
|
-
"
|
25
|
+
"builds openshift v3 infrastructure images"
|
26
26
|
end
|
27
27
|
|
28
28
|
def execute
|
@@ -31,7 +31,7 @@ module Vagrant
|
|
31
31
|
options[:local_source] = false
|
32
32
|
|
33
33
|
opts = OptionParser.new do |o|
|
34
|
-
o.banner = "Usage: vagrant build-
|
34
|
+
o.banner = "Usage: vagrant build-openshift3-base-images"
|
35
35
|
o.separator ""
|
36
36
|
end
|
37
37
|
|
@@ -40,7 +40,7 @@ module Vagrant
|
|
40
40
|
return if !argv
|
41
41
|
|
42
42
|
with_target_vms(argv, :reverse => true) do |machine|
|
43
|
-
actions = Vagrant::Openshift::Action.
|
43
|
+
actions = Vagrant::Openshift::Action.build_openshift3_base_images(options)
|
44
44
|
@env.action_runner.run actions, {:machine => machine}
|
45
45
|
0
|
46
46
|
end
|
data/lib/vagrant-openshift/command/{build_openshift3_infrastructure_images.rb → build_sti.rb}
RENAMED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright
|
2
|
+
# Copyright 2013 Red Hat, Inc.
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -18,11 +18,11 @@ require_relative "../action"
|
|
18
18
|
module Vagrant
|
19
19
|
module Openshift
|
20
20
|
module Commands
|
21
|
-
class
|
21
|
+
class BuildSti < Vagrant.plugin(2, :command)
|
22
22
|
include CommandHelper
|
23
23
|
|
24
24
|
def self.synopsis
|
25
|
-
"builds
|
25
|
+
"builds source-to-image"
|
26
26
|
end
|
27
27
|
|
28
28
|
def execute
|
@@ -31,25 +31,23 @@ module Vagrant
|
|
31
31
|
options[:local_source] = false
|
32
32
|
|
33
33
|
opts = OptionParser.new do |o|
|
34
|
-
o.banner = "Usage: vagrant build-
|
34
|
+
o.banner = "Usage: vagrant build-sti [vm-name]"
|
35
35
|
o.separator ""
|
36
36
|
|
37
|
-
o.on("--
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
37
|
+
o.on("--force", "Build regardless of whether there have been changes.") do |c|
|
38
|
+
options[:force] = true
|
39
|
+
end
|
40
|
+
o.on("--binary-only", "Only build the sti binary, no test images") do |c|
|
41
|
+
options[:binary_only] = true
|
43
42
|
end
|
44
43
|
end
|
45
44
|
|
46
45
|
# Parse the options
|
47
46
|
argv = parse_options(opts)
|
48
47
|
return if !argv
|
49
|
-
raise Vagrant::Errors::CLIInvalidUsage, help: opts.help.chomp unless options[:openshift3_infrastructure_images]
|
50
48
|
|
51
49
|
with_target_vms(argv, :reverse => true) do |machine|
|
52
|
-
actions = Vagrant::Openshift::Action.
|
50
|
+
actions = Vagrant::Openshift::Action.build_sti(options)
|
53
51
|
@env.action_runner.run actions, {:machine => machine}
|
54
52
|
0
|
55
53
|
end
|
@@ -32,7 +32,7 @@ module Vagrant
|
|
32
32
|
o.banner = "Usage: vagrant checkout-repos"
|
33
33
|
o.separator ""
|
34
34
|
|
35
|
-
o.on("-b [
|
35
|
+
o.on("-b [branch-name]", "--branch [branch-name]", String, "Check out the specified branch. Default is 'master'.") do |f|
|
36
36
|
options[:branch] = {"origin-server" => f}
|
37
37
|
end
|
38
38
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright
|
2
|
+
# Copyright 2013 Red Hat, Inc.
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
5
|
# you may not use this file except in compliance with the License.
|
@@ -18,18 +18,18 @@ require_relative "../action"
|
|
18
18
|
module Vagrant
|
19
19
|
module Openshift
|
20
20
|
module Commands
|
21
|
-
class
|
21
|
+
class InstallOpenshift3AssetsBase < Vagrant.plugin(2, :command)
|
22
22
|
include CommandHelper
|
23
23
|
|
24
24
|
def self.synopsis
|
25
|
-
"
|
25
|
+
"installs openshift3 asset dependencies"
|
26
26
|
end
|
27
27
|
|
28
28
|
def execute
|
29
29
|
options = {}
|
30
30
|
|
31
31
|
opts = OptionParser.new do |o|
|
32
|
-
o.banner = "Usage: vagrant install-
|
32
|
+
o.banner = "Usage: vagrant install-openshift3-assets-base [vm-name]"
|
33
33
|
o.separator ""
|
34
34
|
end
|
35
35
|
|
@@ -38,7 +38,7 @@ module Vagrant
|
|
38
38
|
return if !argv
|
39
39
|
|
40
40
|
with_target_vms(argv, :reverse => true) do |machine|
|
41
|
-
actions = Vagrant::Openshift::Action.
|
41
|
+
actions = Vagrant::Openshift::Action.install_openshift3_assets_base(options)
|
42
42
|
@env.action_runner.run actions, {:machine => machine}
|
43
43
|
0
|
44
44
|
end
|
@@ -35,7 +35,7 @@ module Vagrant
|
|
35
35
|
o.banner = "Usage: vagrant openshift3-local-checkout [options]"
|
36
36
|
o.separator ""
|
37
37
|
|
38
|
-
o.on("-b [
|
38
|
+
o.on("-b [branch-name]", "--branch [branch-name]", String, "Check out the specified branch. Default is 'master'.") do |f|
|
39
39
|
options[:branch] = f
|
40
40
|
end
|
41
41
|
|
@@ -28,13 +28,13 @@ module Vagrant
|
|
28
28
|
def execute
|
29
29
|
options = {
|
30
30
|
:no_base => false,
|
31
|
-
:os => '
|
31
|
+
:os => 'centos7',
|
32
32
|
:stage => 'inst',
|
33
33
|
:port_mappings => []
|
34
34
|
}
|
35
35
|
|
36
36
|
valid_stage = ['os','deps','inst']
|
37
|
-
valid_os = ['
|
37
|
+
valid_os = ['centos7','fedora','rhel7']
|
38
38
|
|
39
39
|
opts = OptionParser.new do |o|
|
40
40
|
o.banner = "Usage: vagrant origin-init [vm or instance name]"
|
@@ -44,11 +44,11 @@ module Vagrant
|
|
44
44
|
options[:stage] = f
|
45
45
|
end
|
46
46
|
|
47
|
-
o.on("-o [name]", "--os [name]", String, "Operating system:\n\
|
47
|
+
o.on("-o [name]", "--os [name]", String, "Operating system:\n\tcentos7 [default]\n\tfedora\n\trhel7") do |f|
|
48
48
|
options[:os] = f
|
49
49
|
end
|
50
50
|
|
51
|
-
o.on("-p [guest_port:host_port]", "--map-port [guest_port:host_port]", String, "When running on
|
51
|
+
o.on("-p [guest_port:host_port]", "--map-port [guest_port:host_port]", String, "When running on VirtualBox, map port from guest docker vm to host machine") do |f|
|
52
52
|
options[:port_mappings].push(f.split(":"))
|
53
53
|
end
|
54
54
|
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright 2013 Red Hat, Inc.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#++
|
16
|
+
require_relative "../action"
|
17
|
+
|
18
|
+
module Vagrant
|
19
|
+
module Openshift
|
20
|
+
module Commands
|
21
|
+
class PushOpenshift3Release < Vagrant.plugin(2, :command)
|
22
|
+
include CommandHelper
|
23
|
+
|
24
|
+
def self.synopsis
|
25
|
+
"pushes openshift docker images to a registry"
|
26
|
+
end
|
27
|
+
|
28
|
+
def execute
|
29
|
+
options = {}
|
30
|
+
|
31
|
+
opts = OptionParser.new do |o|
|
32
|
+
o.banner = "Usage: vagrant push-openshift3-release --registry [registry_name] --include-base [vm-name]"
|
33
|
+
o.separator ""
|
34
|
+
|
35
|
+
o.on("--registry [registry_name]", String, "A Docker registry to push images to (include a trailing slash)") do |f|
|
36
|
+
options[:registry_name] = f
|
37
|
+
end
|
38
|
+
|
39
|
+
o.on("--include-base", "Include the base infrastructure images in the push.") do |c|
|
40
|
+
options[:push_base_images] = true
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# Parse the options
|
45
|
+
argv = parse_options(opts)
|
46
|
+
return if !argv
|
47
|
+
|
48
|
+
with_target_vms(argv, :reverse => true) do |machine|
|
49
|
+
actions = Vagrant::Openshift::Action.push_openshift3_release(options)
|
50
|
+
@env.action_runner.run actions, {:machine => machine}
|
51
|
+
0
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -27,11 +27,10 @@ module Vagrant
|
|
27
27
|
|
28
28
|
def execute
|
29
29
|
options = {}
|
30
|
-
options[:
|
30
|
+
options[:images] = true
|
31
31
|
options[:no_build] = false
|
32
32
|
options[:clean] = false
|
33
33
|
options[:source] = false
|
34
|
-
options[:include] = [ Vagrant::Openshift::Constants::FILTER_BROKER , Vagrant::Openshift::Constants::FILTER_CONSOLE ,Vagrant::Openshift::Constants::FILTER_ORIGIN, Vagrant::Openshift::Constants::FILTER_IMAGES, Vagrant::Openshift::Constants::FILTER_RHC]
|
35
34
|
|
36
35
|
opts = OptionParser.new do |o|
|
37
36
|
o.banner = "Usage: vagrant sync-openshift3 [vm-name]"
|
@@ -49,17 +48,6 @@ module Vagrant
|
|
49
48
|
options[:no_build] = true
|
50
49
|
end
|
51
50
|
|
52
|
-
o.on("-i [comp comp]", "--include", String, "Sync specified components. Default: #{options[:include].join " "}") do |f|
|
53
|
-
options[:include] = f.split " "
|
54
|
-
end
|
55
|
-
|
56
|
-
o.on("--openshift3-images [ #{Vagrant::Openshift::Constants.openshift3_images.keys.join(' ')} | all ]", "Specify which images should be synced. Default: []") do |f|
|
57
|
-
if f.split(" ").include?("all")
|
58
|
-
options[:openshift3_images] = Vagrant::Openshift::Constants.openshift3_images.keys
|
59
|
-
else
|
60
|
-
options[:openshift3_images] = f.split(" ")
|
61
|
-
end
|
62
|
-
end
|
63
51
|
end
|
64
52
|
|
65
53
|
# Parse the options
|
@@ -18,43 +18,35 @@ require_relative "../action"
|
|
18
18
|
module Vagrant
|
19
19
|
module Openshift
|
20
20
|
module Commands
|
21
|
-
class
|
21
|
+
class RepoSyncSti < Vagrant.plugin(2, :command)
|
22
22
|
include CommandHelper
|
23
23
|
|
24
24
|
def self.synopsis
|
25
|
-
"syncs
|
25
|
+
"syncs your local repos to the current instance"
|
26
26
|
end
|
27
27
|
|
28
28
|
def execute
|
29
29
|
options = {}
|
30
|
-
options[:clean] = false
|
31
|
-
options[:local_source] = true
|
32
30
|
options[:no_build] = false
|
33
|
-
options[:
|
31
|
+
options[:clean] = false
|
32
|
+
options[:source] = false
|
34
33
|
|
35
34
|
opts = OptionParser.new do |o|
|
36
|
-
o.banner = "Usage: vagrant sync-
|
35
|
+
o.banner = "Usage: vagrant sync-sti [vm-name]"
|
37
36
|
o.separator ""
|
38
37
|
|
39
|
-
o.on("-c", "--clean", "Delete existing repo
|
38
|
+
o.on("-c", "--clean", "Delete existing repo before syncing") do |f|
|
40
39
|
options[:clean] = f
|
41
40
|
end
|
42
41
|
|
43
|
-
o.on("-
|
44
|
-
options[:
|
42
|
+
o.on("-s", "--source", "Sync the source (not required if using synced folders)") do |f|
|
43
|
+
options[:source] = f
|
45
44
|
end
|
46
45
|
|
47
|
-
o.on("--install
|
48
|
-
options[:
|
46
|
+
o.on("--dont-install", "Don't build and install updated source") do |f|
|
47
|
+
options[:no_build] = true
|
49
48
|
end
|
50
49
|
|
51
|
-
o.on("--dont-install", "Don't build and install RPMs") do |f|
|
52
|
-
options[:no_build] = f
|
53
|
-
end
|
54
|
-
|
55
|
-
o.on("-d","--artifacts", String, "Download logs and rpms") do |f|
|
56
|
-
options[:download] = true
|
57
|
-
end
|
58
50
|
end
|
59
51
|
|
60
52
|
# Parse the options
|
@@ -62,7 +54,7 @@ module Vagrant
|
|
62
54
|
return if !argv
|
63
55
|
|
64
56
|
with_target_vms(argv, :reverse => true) do |machine|
|
65
|
-
actions = Vagrant::Openshift::Action.
|
57
|
+
actions = Vagrant::Openshift::Action.repo_sync_sti(options)
|
66
58
|
@env.action_runner.run actions, {:machine => machine}
|
67
59
|
0
|
68
60
|
end
|