vagrant-openshift 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/.gitattributes +1 -0
  3. data/.gitignore +24 -0
  4. data/Gemfile +11 -0
  5. data/LICENSE.txt +13 -0
  6. data/README.asciidoc +379 -0
  7. data/Rakefile +53 -0
  8. data/lib/vagrant-openshift/action/build_geard.rb +41 -0
  9. data/lib/vagrant-openshift/action/build_geard_broker.rb +59 -0
  10. data/lib/vagrant-openshift/action/build_geard_console.rb +55 -0
  11. data/lib/vagrant-openshift/action/build_geard_images.rb +54 -0
  12. data/lib/vagrant-openshift/action/build_sources.rb +39 -0
  13. data/lib/vagrant-openshift/action/checkout_repositories.rb +72 -0
  14. data/lib/vagrant-openshift/action/checkout_tests.rb +57 -0
  15. data/lib/vagrant-openshift/action/clean.rb +51 -0
  16. data/lib/vagrant-openshift/action/clean_network_setup.rb +52 -0
  17. data/lib/vagrant-openshift/action/clone_upstream_repositories.rb +65 -0
  18. data/lib/vagrant-openshift/action/create_ami.rb +54 -0
  19. data/lib/vagrant-openshift/action/create_bare_repo_placeholders.rb +53 -0
  20. data/lib/vagrant-openshift/action/create_puppet_file.rb +84 -0
  21. data/lib/vagrant-openshift/action/create_test_users.rb +36 -0
  22. data/lib/vagrant-openshift/action/create_yum_repositories.rb +121 -0
  23. data/lib/vagrant-openshift/action/download_artifacts.rb +70 -0
  24. data/lib/vagrant-openshift/action/generate_template.rb +89 -0
  25. data/lib/vagrant-openshift/action/idle_all_gears.rb +36 -0
  26. data/lib/vagrant-openshift/action/install_build_dependencies.rb +48 -0
  27. data/lib/vagrant-openshift/action/install_geard.rb +76 -0
  28. data/lib/vagrant-openshift/action/install_geard_base_dependencies.rb +72 -0
  29. data/lib/vagrant-openshift/action/install_geard_broker.rb +39 -0
  30. data/lib/vagrant-openshift/action/install_geard_images.rb +51 -0
  31. data/lib/vagrant-openshift/action/install_open_shift_dependencies.rb +50 -0
  32. data/lib/vagrant-openshift/action/install_rhc.rb +42 -0
  33. data/lib/vagrant-openshift/action/local_geard_checkout.rb +58 -0
  34. data/lib/vagrant-openshift/action/local_repo_checkout.rb +47 -0
  35. data/lib/vagrant-openshift/action/modify_ami.rb +54 -0
  36. data/lib/vagrant-openshift/action/modify_instance.rb +71 -0
  37. data/lib/vagrant-openshift/action/prepare_ssh_config.rb +89 -0
  38. data/lib/vagrant-openshift/action/preserve_mcollective_logs.rb +48 -0
  39. data/lib/vagrant-openshift/action/restart_geard.rb +39 -0
  40. data/lib/vagrant-openshift/action/restart_geard_broker.rb +43 -0
  41. data/lib/vagrant-openshift/action/restart_geard_console.rb +43 -0
  42. data/lib/vagrant-openshift/action/run_geard_tests.rb +57 -0
  43. data/lib/vagrant-openshift/action/run_tests.rb +47 -0
  44. data/lib/vagrant-openshift/action/set_host_name.rb +43 -0
  45. data/lib/vagrant-openshift/action/setup_bind_dns_key.rb +38 -0
  46. data/lib/vagrant-openshift/action/setup_bind_host.rb +141 -0
  47. data/lib/vagrant-openshift/action/setup_builder_files.rb +57 -0
  48. data/lib/vagrant-openshift/action/setup_geard_broker.rb +71 -0
  49. data/lib/vagrant-openshift/action/sync_local_repository.rb +115 -0
  50. data/lib/vagrant-openshift/action/sync_upstream_repository.rb +71 -0
  51. data/lib/vagrant-openshift/action/test_exit_code.rb +36 -0
  52. data/lib/vagrant-openshift/action/uninstall_openshift_rpms.rb +37 -0
  53. data/lib/vagrant-openshift/action/yum_update.rb +67 -0
  54. data/lib/vagrant-openshift/action.rb +308 -0
  55. data/lib/vagrant-openshift/command/build_geard.rb +51 -0
  56. data/lib/vagrant-openshift/command/build_geard_base.rb +51 -0
  57. data/lib/vagrant-openshift/command/build_geard_broker.rb +59 -0
  58. data/lib/vagrant-openshift/command/build_geard_console.rb +59 -0
  59. data/lib/vagrant-openshift/command/build_geard_images.rb +68 -0
  60. data/lib/vagrant-openshift/command/build_origin_base.rb +51 -0
  61. data/lib/vagrant-openshift/command/checkout_repositories.rb +55 -0
  62. data/lib/vagrant-openshift/command/clone_upstream_repositories.rb +54 -0
  63. data/lib/vagrant-openshift/command/create_ami.rb +49 -0
  64. data/lib/vagrant-openshift/command/install_geard.rb +51 -0
  65. data/lib/vagrant-openshift/command/install_geard_broker.rb +51 -0
  66. data/lib/vagrant-openshift/command/install_rhc.rb +49 -0
  67. data/lib/vagrant-openshift/command/local_geard_setup.rb +62 -0
  68. data/lib/vagrant-openshift/command/local_repo_setup.rb +62 -0
  69. data/lib/vagrant-openshift/command/modify_ami.rb +54 -0
  70. data/lib/vagrant-openshift/command/modify_instance.rb +63 -0
  71. data/lib/vagrant-openshift/command/openshift_init.rb +83 -0
  72. data/lib/vagrant-openshift/command/repo_sync.rb +73 -0
  73. data/lib/vagrant-openshift/command/repo_sync_geard.rb +78 -0
  74. data/lib/vagrant-openshift/command/restart_geard.rb +51 -0
  75. data/lib/vagrant-openshift/command/restart_geard_broker.rb +51 -0
  76. data/lib/vagrant-openshift/command/restart_geard_console.rb +51 -0
  77. data/lib/vagrant-openshift/command/setup_geard_broker.rb +49 -0
  78. data/lib/vagrant-openshift/command/test.rb +108 -0
  79. data/lib/vagrant-openshift/command/test_geard.rb +59 -0
  80. data/lib/vagrant-openshift/command/test_geard_image.rb +147 -0
  81. data/lib/vagrant-openshift/config.rb +56 -0
  82. data/lib/vagrant-openshift/constants.rb +111 -0
  83. data/lib/vagrant-openshift/helper/command_helper.rb +213 -0
  84. data/lib/vagrant-openshift/plugin.rb +171 -0
  85. data/lib/vagrant-openshift/provisioner.rb +82 -0
  86. data/lib/vagrant-openshift/templates/builder/Rakefile +231 -0
  87. data/lib/vagrant-openshift/templates/builder/lib/.gitkeep +0 -0
  88. data/lib/vagrant-openshift/templates/builder/lib/rpm.rb +248 -0
  89. data/lib/vagrant-openshift/templates/builder/lib/test.rb +432 -0
  90. data/lib/vagrant-openshift/templates/builder/yum-listbuilddep +124 -0
  91. data/lib/vagrant-openshift/templates/command/init-openshift/Vagrantfile.erb +175 -0
  92. data/lib/vagrant-openshift/templates/command/init-openshift/box_info.yaml +152 -0
  93. data/lib/vagrant-openshift/version.rb +21 -0
  94. data/lib/vagrant-openshift.rb +34 -0
  95. data/vagrant-openshift.gemspec +43 -0
  96. metadata +234 -0
@@ -0,0 +1,308 @@
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 "vagrant/action/builder"
17
+ require "pathname"
18
+
19
+ module Vagrant
20
+ module Openshift
21
+ module Action
22
+ include Vagrant::Action::Builtin
23
+
24
+ def self.build_origin_base(options)
25
+ Vagrant::Action::Builder.new.tap do |b|
26
+ b.use CreateYumRepositories
27
+ b.use YumUpdate
28
+ b.use InstallBuildDependencies
29
+ b.use SetupBuilderFiles
30
+ b.use Clean
31
+ b.use CloneUpstreamRepositories
32
+ b.use SetHostName
33
+ b.use SetupBindDnsKey
34
+ b.use CheckoutRepositories
35
+ b.use InstallOpenShiftDependencies
36
+ b.use CreatePuppetFile
37
+ end
38
+ end
39
+
40
+ def self.build_geard_base(options)
41
+ Vagrant::Action::Builder.new.tap do |b|
42
+ b.use CreateYumRepositories
43
+ b.use YumUpdate
44
+ b.use InstallGeardBaseDependencies
45
+ b.use InstallGeardImages
46
+ b.use SetHostName
47
+ b.use SetupBindHost
48
+ #b.use CreatePuppetFile
49
+ end
50
+ end
51
+
52
+ def self.install_geard(options)
53
+ Vagrant::Action::Builder.new.tap do |b|
54
+ b.use CreateYumRepositories
55
+ b.use YumUpdate
56
+ b.use SetHostName
57
+ b.use InstallGeard
58
+ b.use BuildGeard
59
+ b.use RestartGeard
60
+ end
61
+ end
62
+
63
+ def self.install_geard_broker(options)
64
+ Vagrant::Action::Builder.new.tap do |b|
65
+ b.use InstallGeardBroker
66
+ end
67
+ end
68
+
69
+ def self.build_geard(options)
70
+ Vagrant::Action::Builder.new.tap do |b|
71
+ b.use BuildGeard
72
+ end
73
+ end
74
+
75
+ def self.restart_geard(options)
76
+ Vagrant::Action::Builder.new.tap do |b|
77
+ b.use RestartGeard
78
+ end
79
+ end
80
+
81
+ def self.restart_geard_broker(options)
82
+ Vagrant::Action::Builder.new.tap do |b|
83
+ b.use RestartGeardBroker
84
+ end
85
+ end
86
+
87
+ def self.build_geard_broker(options)
88
+ Vagrant::Action::Builder.new.tap do |b|
89
+ b.use BuildGeardBroker, options
90
+ end
91
+ end
92
+
93
+ def self.restart_geard_console(options)
94
+ Vagrant::Action::Builder.new.tap do |b|
95
+ b.use RestartGeardConsole
96
+ end
97
+ end
98
+
99
+ def self.build_geard_console(options)
100
+ Vagrant::Action::Builder.new.tap do |b|
101
+ b.use BuildGeardConsole, options
102
+ end
103
+ end
104
+
105
+ def self.build_geard_images(options)
106
+ Vagrant::Action::Builder.new.tap do |b|
107
+ b.use BuildGeardImages, options
108
+ end
109
+ end
110
+
111
+ def self.repo_sync(options)
112
+ Vagrant::Action::Builder.new.tap do |b|
113
+ b.use PrepareSshConfig
114
+ if options[:clean]
115
+ b.use Clean
116
+ b.use SetupBuilderFiles
117
+ b.use CreatePuppetFile
118
+ if options[:local_source]
119
+ b.use CreateBareRepoPlaceholders
120
+ else
121
+ b.use CloneUpstreamRepositories
122
+ end
123
+ end
124
+
125
+ if options[:local_source]
126
+ b.use SyncLocalRepository
127
+ else
128
+ b.use SyncUpstreamRepository
129
+ end
130
+ b.use CheckoutRepositories
131
+ b.use InstallOpenShiftDependencies if options[:deps]
132
+ b.use UninstallOpenShiftRpms if options[:clean]
133
+ b.use BuildSources unless options[:no_build]
134
+ if options[:download]
135
+ b.use DownloadArtifacts
136
+ end
137
+ end
138
+ end
139
+
140
+ def self.repo_sync_geard(options)
141
+ Vagrant::Action::Builder.new.tap do |b|
142
+ b.use PrepareSshConfig
143
+ if options[:source]
144
+ if options[:clean]
145
+ b.use Clean
146
+ b.use CloneUpstreamRepositories
147
+ end
148
+ b.use SyncLocalRepository
149
+ b.use CheckoutRepositories
150
+ end
151
+ unless options[:no_build]
152
+ b.use BuildGeard if options[:include].include? Vagrant::Openshift::Constants::FILTER_GEARD
153
+ b.use RestartGeard if options[:include].include? Vagrant::Openshift::Constants::FILTER_GEARD
154
+ b.use BuildGeardImages, options if options[:include].include? Vagrant::Openshift::Constants::FILTER_IMAGES
155
+ b.use BuildGeardBroker if options[:include].include? Vagrant::Openshift::Constants::FILTER_BROKER
156
+ b.use RestartGeardBroker if options[:include].include? Vagrant::Openshift::Constants::FILTER_BROKER
157
+ b.use BuildGeardConsole if options[:include].include? Vagrant::Openshift::Constants::FILTER_CONSOLE
158
+ b.use RestartGeardConsole if options[:include].include? Vagrant::Openshift::Constants::FILTER_CONSOLE
159
+ b.use InstallRhc if options[:include].include? Vagrant::Openshift::Constants::FILTER_RHC
160
+ end
161
+ end
162
+ end
163
+
164
+ def self.local_repo_checkout(options)
165
+ Vagrant::Action::Builder.new.tap do |b|
166
+ if not options[:no_build]
167
+ b.use LocalRepoCheckout, options
168
+ end
169
+ end
170
+ end
171
+
172
+ def self.local_geard_checkout(options)
173
+ Vagrant::Action::Builder.new.tap do |b|
174
+ if not options[:no_build]
175
+ b.use LocalGeardCheckout, options
176
+ end
177
+ end
178
+ end
179
+
180
+ def self.run_tests(options)
181
+ Vagrant::Action::Builder.new.tap do |b|
182
+ b.use CreateTestUsers
183
+ b.use PreserveMcollectiveLogs
184
+ b.use IdleAllGears
185
+ b.use CheckoutTests
186
+ b.use RunTests, options
187
+ if options[:download]
188
+ b.use DownloadArtifacts
189
+ end
190
+ b.use TestExitCode
191
+ end
192
+ end
193
+
194
+ def self.run_geard_tests(options)
195
+ Vagrant::Action::Builder.new.tap do |b|
196
+ b.use RunGeardTests, options
197
+ if options[:download]
198
+ b.use DownloadArtifacts
199
+ end
200
+ b.use TestExitCode
201
+ end
202
+ end
203
+
204
+ def self.gen_vagrant_file(options)
205
+ Vagrant::Action::Builder.new.tap do |b|
206
+ b.use GenerateTemplate, options
207
+ end
208
+ end
209
+
210
+ def self.create_ami(options)
211
+ Vagrant::Action::Builder.new.tap do |b|
212
+ b.use CleanNetworkSetup
213
+ b.use ConfigValidate
214
+ b.use VagrantPlugins::AWS::Action::ConnectAWS
215
+ b.use CreateAMI, options
216
+ end
217
+ end
218
+
219
+ def self.modify_instance(options)
220
+ Vagrant::Action::Builder.new.tap do |b|
221
+ b.use ConfigValidate
222
+ b.use VagrantPlugins::AWS::Action::ConnectAWS
223
+ b.use ModifyInstance, options
224
+ end
225
+ end
226
+
227
+ def self.modify_ami(options)
228
+ Vagrant::Action::Builder.new.tap do |b|
229
+ b.use ConfigValidate
230
+ b.use VagrantPlugins::AWS::Action::ConnectAWS
231
+ b.use ModifyAMI, options
232
+ end
233
+ end
234
+
235
+ def self.clone_upstream_repositories(options)
236
+ Vagrant::Action::Builder.new.tap do |b|
237
+ b.use CloneUpstreamRepositories, options
238
+ end
239
+ end
240
+
241
+ def self.checkout_repositories(options)
242
+ Vagrant::Action::Builder.new.tap do |b|
243
+ b.use CheckoutRepositories, options
244
+ end
245
+ end
246
+
247
+ def self.install_rhc(options)
248
+ Vagrant::Action::Builder.new.tap do |b|
249
+ b.use InstallRhc
250
+ end
251
+ end
252
+
253
+ def self.setup_geard_broker(options)
254
+ Vagrant::Action::Builder.new.tap do |b|
255
+ b.use SetupGeardBroker
256
+ end
257
+ end
258
+
259
+ action_root = Pathname.new(File.expand_path("../action", __FILE__))
260
+ autoload :Clean, action_root.join("clean")
261
+ autoload :UninstallOpenShiftRpms, action_root.join("uninstall_openshift_rpms")
262
+ autoload :CloneUpstreamRepositories, action_root.join("clone_upstream_repositories")
263
+ autoload :CreateYumRepositories, action_root.join("create_yum_repositories")
264
+ autoload :CreatePuppetFile, action_root.join("create_puppet_file")
265
+ autoload :InstallOpenShiftDependencies, action_root.join("install_open_shift_dependencies")
266
+ autoload :CheckoutRepositories, action_root.join("checkout_repositories")
267
+ autoload :SetupBindDnsKey, action_root.join("setup_bind_dns_key")
268
+ autoload :SetHostName, action_root.join("set_host_name")
269
+ autoload :YumUpdate, action_root.join("yum_update")
270
+ autoload :SetupBuilderFiles, action_root.join("setup_builder_files")
271
+ autoload :InstallBuildDependencies, action_root.join("install_build_dependencies")
272
+ autoload :BuildGeardBroker, action_root.join("build_geard_broker")
273
+ autoload :BuildGeardConsole, action_root.join("build_geard_console")
274
+ autoload :BuildGeardImages, action_root.join("build_geard_images")
275
+ autoload :InstallGeardBaseDependencies, action_root.join("install_geard_base_dependencies")
276
+ autoload :InstallGeardImages, action_root.join("install_geard_images")
277
+ autoload :InstallGeard, action_root.join("install_geard")
278
+ autoload :InstallGeardBroker, action_root.join("install_geard_broker")
279
+ autoload :BuildGeard, action_root.join("build_geard")
280
+ autoload :RestartGeard, action_root.join("restart_geard")
281
+ autoload :RestartGeardBroker, action_root.join("restart_geard_broker")
282
+ autoload :RestartGeardConsole, action_root.join("restart_geard_console")
283
+ autoload :PrepareSshConfig, action_root.join("prepare_ssh_config")
284
+ autoload :SyncLocalRepository, action_root.join("sync_local_repository")
285
+ autoload :SyncUpstreamRepository, action_root.join("sync_upstream_repository")
286
+ autoload :BuildSources, action_root.join("build_sources")
287
+ autoload :LocalRepoCheckout, action_root.join("local_repo_checkout")
288
+ autoload :LocalGeardCheckout, action_root.join("local_geard_checkout")
289
+ autoload :CreateBareRepoPlaceholders, action_root.join("create_bare_repo_placeholders")
290
+ autoload :CreateTestUsers, action_root.join("create_test_users")
291
+ autoload :IdleAllGears, action_root.join("idle_all_gears")
292
+ autoload :PreserveMcollectiveLogs, action_root.join("preserve_mcollective_logs")
293
+ autoload :RunTests, action_root.join("run_tests")
294
+ autoload :RunGeardTests, action_root.join("run_geard_tests")
295
+ autoload :CheckoutTests, action_root.join("checkout_tests")
296
+ autoload :GenerateTemplate, action_root.join("generate_template")
297
+ autoload :CreateAMI, action_root.join("create_ami")
298
+ autoload :ModifyInstance, action_root.join("modify_instance")
299
+ autoload :ModifyAMI, action_root.join("modify_ami")
300
+ autoload :DownloadArtifacts, action_root.join("download_artifacts")
301
+ autoload :TestExitCode, action_root.join("test_exit_code")
302
+ autoload :CleanNetworkSetup, action_root.join("clean_network_setup")
303
+ autoload :InstallRhc, action_root.join("install_rhc")
304
+ autoload :SetupGeardBroker, action_root.join("setup_geard_broker")
305
+ autoload :SetupBindHost, action_root.join("setup_bind_host")
306
+ end
307
+ end
308
+ end
@@ -0,0 +1,51 @@
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 BuildGeard < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "builds geard"
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+ options[:clean] = false
31
+ options[:local_source] = false
32
+
33
+ opts = OptionParser.new do |o|
34
+ o.banner = "Usage: vagrant build-geard [vm-name]"
35
+ o.separator ""
36
+ end
37
+
38
+ # Parse the options
39
+ argv = parse_options(opts)
40
+ return if !argv
41
+
42
+ with_target_vms(argv, :reverse => true) do |machine|
43
+ actions = Vagrant::Openshift::Action.build_geard(options)
44
+ @env.action_runner.run actions, {:machine => machine}
45
+ 0
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
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 BuildGeardBase < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "install the prereqs for geard"
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+ options[:clean] = false
31
+ options[:local_source] = false
32
+
33
+ opts = OptionParser.new do |o|
34
+ o.banner = "Usage: vagrant build-geard-base [vm-name]"
35
+ o.separator ""
36
+ end
37
+
38
+ # Parse the options
39
+ argv = parse_options(opts)
40
+ return if !argv
41
+
42
+ with_target_vms(argv, :reverse => true) do |machine|
43
+ actions = Vagrant::Openshift::Action.build_geard_base(options)
44
+ @env.action_runner.run actions, {:machine => machine}
45
+ 0
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,59 @@
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 BuildGeardBroker < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "builds and installs the broker for geard"
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+ options[:clean] = false
31
+ options[:local_source] = false
32
+
33
+ opts = OptionParser.new do |o|
34
+ o.banner = "Usage: vagrant build-geard-broker [vm-name]"
35
+ o.separator ""
36
+
37
+ o.on("-b [branch_name]", "--branch [branch_name]", String, "Check out the specified branch. Default is 'master'.") do |f|
38
+ options[:branch] = {"origin-server" => f}
39
+ end
40
+
41
+ o.on("-f", "--force", "Force a rebuild of the broker even if there has not been a change to the source.") do |c|
42
+ options[:force] = true
43
+ end
44
+ end
45
+
46
+ # Parse the options
47
+ argv = parse_options(opts)
48
+ return if !argv
49
+
50
+ with_target_vms(argv, :reverse => true) do |machine|
51
+ actions = Vagrant::Openshift::Action.build_geard_broker(options)
52
+ @env.action_runner.run actions, {:machine => machine}
53
+ 0
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,59 @@
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 BuildGeardConsole < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "builds and installs the console for geard"
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+ options[:clean] = false
31
+ options[:local_source] = false
32
+
33
+ opts = OptionParser.new do |o|
34
+ o.banner = "Usage: vagrant build-geard-console [vm-name]"
35
+ o.separator ""
36
+
37
+ o.on("-b [branch_name]", "--branch [branch_name]", String, "Check out the specified branch. Default is 'master'.") do |f|
38
+ options[:branch] = {"origin-server" => f}
39
+ end
40
+
41
+ o.on("-f", "--force", "Force a rebuild of the console even if there has not been a change to the source.") do |c|
42
+ options[:force] = true
43
+ end
44
+ end
45
+
46
+ # Parse the options
47
+ argv = parse_options(opts)
48
+ return if !argv
49
+
50
+ with_target_vms(argv, :reverse => true) do |machine|
51
+ actions = Vagrant::Openshift::Action.build_geard_console(options)
52
+ @env.action_runner.run actions, {:machine => machine}
53
+ 0
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,68 @@
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 BuildGeardImages < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "builds openshift docker images"
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+ options[:clean] = false
31
+ options[:local_source] = false
32
+
33
+ opts = OptionParser.new do |o|
34
+ o.banner = "Usage: vagrant build-geard-images --geard-images image_name [vm-name]"
35
+ o.separator ""
36
+
37
+ o.on("-b [branch_name]", "--branch [branch_name]", String, "Check out the specified branch. Default is 'master'.") do |f|
38
+ options[:branch] = {"origin-server" => f}
39
+ end
40
+
41
+ o.on("-f", "--force", "Force a rebuild of the images even if there has not been a change to the source.") do |c|
42
+ options[:force] = true
43
+ end
44
+
45
+ o.on("--geard-images #{Vagrant::Openshift::Constants.geard_images.keys.join(' ')} | all", "Specify which images should be built. Default: []") do |f|
46
+ if f.split(" ").include?("all")
47
+ options[:geard_images] = Vagrant::Openshift::Constants.geard_images.keys
48
+ else
49
+ options[:geard_images] = f.split(" ")
50
+ end
51
+ end
52
+ end
53
+
54
+ # Parse the options
55
+ argv = parse_options(opts)
56
+ return if !argv
57
+ raise Vagrant::Errors::CLIInvalidUsage, help: opts.help.chomp unless options[:geard_images]
58
+
59
+ with_target_vms(argv, :reverse => true) do |machine|
60
+ actions = Vagrant::Openshift::Action.build_geard_images(options)
61
+ @env.action_runner.run actions, {:machine => machine}
62
+ 0
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,51 @@
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 BuildOriginBase < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "installs the prereqs for origin"
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+ options[:clean] = false
31
+ options[:local_source] = false
32
+
33
+ opts = OptionParser.new do |o|
34
+ o.banner = "Usage: vagrant origin-build-base [vm-name]"
35
+ o.separator ""
36
+ end
37
+
38
+ # Parse the options
39
+ argv = parse_options(opts)
40
+ return if !argv
41
+
42
+ with_target_vms(argv, :reverse => true) do |machine|
43
+ actions = Vagrant::Openshift::Action.build_origin_base(options)
44
+ @env.action_runner.run actions, {:machine => machine}
45
+ 0
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end