vagrant-openshift 1.0.20 → 2.0.0
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/.gitignore +1 -0
- data/README.asciidoc +30 -17
- data/lib/vagrant-openshift/action.rb +66 -41
- data/lib/vagrant-openshift/action/bootstrap_openshift.rb +34 -0
- data/lib/vagrant-openshift/action/{build_openshift3.rb → build_openshift.rb} +1 -1
- data/lib/vagrant-openshift/action/{build_openshift3_base_images.rb → build_openshift_base_images.rb} +1 -1
- data/lib/vagrant-openshift/action/clone_upstream_repositories.rb +3 -2
- data/lib/vagrant-openshift/action/create_ami.rb +19 -3
- data/lib/vagrant-openshift/action/create_sample_project.rb +39 -0
- data/lib/vagrant-openshift/action/create_yum_repositories.rb +1 -1
- data/lib/vagrant-openshift/action/{download_artifacts_openshift3.rb → download_artifacts_openshift.rb} +1 -1
- data/lib/vagrant-openshift/action/generate_template.rb +12 -5
- data/lib/vagrant-openshift/action/install_docker_registry.rb +47 -0
- data/lib/vagrant-openshift/action/{install_openshift3.rb → install_openshift.rb} +7 -5
- data/lib/vagrant-openshift/action/{install_openshift3_asset_dependencies.rb → install_openshift_asset_dependencies.rb} +1 -1
- data/lib/vagrant-openshift/action/{install_openshift3_base_dependencies.rb → install_openshift_base_dependencies.rb} +2 -2
- data/lib/vagrant-openshift/action/{install_openshift3_images.rb → install_openshift_images.rb} +1 -1
- data/lib/vagrant-openshift/action/{install_openshift3_rhel7.rb → install_openshift_rhel7.rb} +1 -1
- data/lib/vagrant-openshift/action/{install_openshift3_router.rb → install_openshift_router.rb} +3 -3
- data/lib/vagrant-openshift/action/{local_openshift3_checkout.rb → local_openshift_checkout.rb} +2 -2
- data/lib/vagrant-openshift/action/{push_openshift3_images.rb → push_openshift_images.rb} +3 -3
- data/lib/vagrant-openshift/action/{push_openshift3_release.rb → push_openshift_release.rb} +1 -1
- data/lib/vagrant-openshift/action/{run_openshift3_tests.rb → run_openshift_tests.rb} +1 -1
- data/lib/vagrant-openshift/action/run_systemctl.rb +2 -2
- data/lib/vagrant-openshift/action/setup_sample_policy.rb +42 -0
- data/lib/vagrant-openshift/action/sync_local_repository.rb +1 -5
- data/lib/vagrant-openshift/action/wait_for_openshift.rb +61 -0
- data/lib/vagrant-openshift/command/bootstrap_openshift.rb +50 -0
- data/lib/vagrant-openshift/command/{build_openshift3.rb → build_openshift.rb} +3 -4
- data/lib/vagrant-openshift/command/{build_openshift3_base.rb → build_openshift_base.rb} +3 -4
- data/lib/vagrant-openshift/command/{build_openshift3_base_images.rb → build_openshift_base_images.rb} +4 -5
- data/lib/vagrant-openshift/command/build_sti.rb +0 -1
- data/lib/vagrant-openshift/command/install_docker_registry.rb +50 -0
- data/lib/vagrant-openshift/command/{install_openshift3.rb → install_openshift.rb} +4 -5
- data/lib/vagrant-openshift/command/{install_openshift3_assets_base.rb → install_openshift_assets_base.rb} +4 -4
- data/lib/vagrant-openshift/command/{install_openshift3_router.rb → install_openshift_router.rb} +4 -5
- data/lib/vagrant-openshift/command/{local_openshift3_setup.rb → local_openshift_setup.rb} +3 -3
- data/lib/vagrant-openshift/command/openshift_init.rb +10 -5
- data/lib/vagrant-openshift/command/{push_openshift3_images.rb → push_openshift_images.rb} +4 -4
- data/lib/vagrant-openshift/command/{push_openshift3_release.rb → push_openshift_release.rb} +3 -3
- data/lib/vagrant-openshift/command/{repo_sync_openshift3.rb → repo_sync_openshift.rb} +3 -3
- data/lib/vagrant-openshift/command/{test_openshift3.rb → test_openshift.rb} +3 -3
- data/lib/vagrant-openshift/command/{test_openshift3_image.rb → test_openshift_image.rb} +2 -2
- data/lib/vagrant-openshift/command/{try_restart_openshift3.rb → try_restart_openshift.rb} +4 -5
- data/lib/vagrant-openshift/constants.rb +6 -5
- data/lib/vagrant-openshift/helper/command_helper.rb +3 -0
- data/lib/vagrant-openshift/plugin.rb +50 -40
- data/lib/vagrant-openshift/templates/command/init-openshift/box_info.yaml +42 -2
- data/lib/vagrant-openshift/version.rb +1 -1
- metadata +35 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b91334619f954dd65a30a86f9d39bf0d8bef0eff
|
4
|
+
data.tar.gz: 4e33f84aeeb48885bfd3adf47333d14557d91c83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16c9b08cc1f21f9bcc4291500bc96d26b02f38aac2f8b1659a64629e18752f0219bb5a385438144b15c780a33a3198139c86e3d33aee534bd023ca6c711b13c8
|
7
|
+
data.tar.gz: 3449a265440af515971b5b6ca842c0df01259b6f5e075f9faeded5448a558144f0dc5afbbd1c3ff6f1f6531ac22b50822a1333b3b9df5370c1f96dd480a96bd2
|
data/.gitignore
CHANGED
data/README.asciidoc
CHANGED
@@ -55,7 +55,7 @@ $ vagrant plugin install vagrant-openshift
|
|
55
55
|
|
56
56
|
This plugin works in concert with the
|
57
57
|
link:https://github.com/openshift/origin/blob/master/Vagrantfile[OpenShift Origin Vagrantfile]
|
58
|
-
to build and update OpenShift
|
58
|
+
to build and update OpenShift development environments.
|
59
59
|
|
60
60
|
==== Clone the OpenShift Origin repositories
|
61
61
|
|
@@ -77,7 +77,7 @@ Then clone the repositories into your GOPATH.
|
|
77
77
|
[source, sh]
|
78
78
|
----
|
79
79
|
$ cd $GOPATH
|
80
|
-
$ vagrant
|
80
|
+
$ vagrant openshift-local-checkout -u <github username>
|
81
81
|
$ cd src/github.com/openshift/origin
|
82
82
|
----
|
83
83
|
|
@@ -113,7 +113,7 @@ NOTE: See link:#other-providers[Other Providers] below for launching VMs from ot
|
|
113
113
|
|
114
114
|
[source, sh]
|
115
115
|
----
|
116
|
-
$ vagrant sync-
|
116
|
+
$ vagrant sync-openshift
|
117
117
|
----
|
118
118
|
|
119
119
|
For some providers, your local repositories are automatically synchronized
|
@@ -128,7 +128,7 @@ rebuild only the OpenShift binary, use the `--no-images` option.
|
|
128
128
|
|
129
129
|
[source, sh]
|
130
130
|
----
|
131
|
-
$ vagrant test-
|
131
|
+
$ vagrant test-openshift --all
|
132
132
|
----
|
133
133
|
|
134
134
|
|
@@ -385,11 +385,12 @@ Ideally you would be able to use an image with the operating system,
|
|
385
385
|
dependencies, and OpenShift already installed so you can just start
|
386
386
|
hacking. But at this time that is not available for all providers.
|
387
387
|
|
388
|
-
Images may be thought of as being at one of
|
388
|
+
Images may be thought of as being at one of four stages:
|
389
389
|
|
390
390
|
1. "os" - The base OS image (use a "minimal" one).
|
391
391
|
2. "deps" - OpenShift runtime dependencies and build requirements are installed.
|
392
392
|
3. "inst" - OpenShift code, images, and binaries are built and installed
|
393
|
+
4. "bootstrap" - OpenShift installed and running
|
393
394
|
|
394
395
|
You may want to create images that snapshot the output at each of
|
395
396
|
these stages, as the rate of change and amount of time to create each
|
@@ -401,30 +402,42 @@ you will need to install the build tools and other dependencies for
|
|
401
402
|
building and running OpenShift. The following vagrant commands should
|
402
403
|
help with this:
|
403
404
|
|
405
|
+
[source, sh]
|
404
406
|
----
|
405
|
-
$ vagrant build-
|
406
|
-
$ vagrant build-
|
407
|
-
$ vagrant install-
|
407
|
+
$ vagrant build-openshift-base
|
408
|
+
$ vagrant build-openshift-base-images
|
409
|
+
$ vagrant install-openshift-assets-base
|
408
410
|
----
|
409
411
|
|
410
412
|
Given this base foundation, you may want to `vagrant package` the result before proceeding to install OpenShift code.
|
411
413
|
|
414
|
+
[source, sh]
|
412
415
|
----
|
413
|
-
$ vagrant install-
|
414
|
-
$ vagrant build-
|
415
|
-
$ vagrant build-
|
416
|
+
$ vagrant install-openshift
|
417
|
+
$ vagrant build-openshift-base-images # pick up updates if older "deps" base reused
|
418
|
+
$ vagrant build-openshift --images
|
416
419
|
$ vagrant build-sti --binary-only
|
417
420
|
----
|
418
421
|
|
419
|
-
|
422
|
+
=== Creating a "bootstrap" Vagrant Box
|
420
423
|
|
421
|
-
|
422
|
-
you may do the following to get the host prepared for a git-based sync
|
423
|
-
and then use that:
|
424
|
+
Assuming you are targeting the v0.4.4 for your vagrant box
|
424
425
|
|
426
|
+
[source, sh]
|
425
427
|
----
|
426
|
-
$
|
427
|
-
$ vagrant
|
428
|
+
$ cd ~/tmp
|
429
|
+
$ vagrant openshift-local-checkout --replace --branch v0.4.4
|
430
|
+
$ pushd origin
|
431
|
+
$ vagrant origin-init --stage inst --os fedora openshift-bootstrap --no-synced-folders
|
432
|
+
$ vagrant up
|
433
|
+
$ vagrant clone-upstream-repos --clean
|
434
|
+
$ vagrant checkout-repos --branch v0.4.4
|
435
|
+
$ vagrant build-openshift --images
|
436
|
+
$ vagrant build-sti --binary-only
|
437
|
+
$ vagrant bootstrap-openshift
|
438
|
+
|
439
|
+
$ rm -f /tmp/fedora_virtualbox_bootstrap.box
|
440
|
+
$ vagrant package --output /tmp/fedora_virtualbox_bootstrap.box
|
428
441
|
----
|
429
442
|
|
430
443
|
== Notice of Export Control Law
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright 2013 Red Hat, Inc.
|
2
|
+
# Copyright 2013-2015 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.
|
@@ -21,48 +21,48 @@ module Vagrant
|
|
21
21
|
module Action
|
22
22
|
include Vagrant::Action::Builtin
|
23
23
|
|
24
|
-
def self.
|
24
|
+
def self.build_openshift_base(options)
|
25
25
|
Vagrant::Action::Builder.new.tap do |b|
|
26
26
|
b.use CreateYumRepositories
|
27
27
|
b.use YumUpdate
|
28
28
|
b.use SetHostName
|
29
|
-
b.use
|
29
|
+
b.use InstallOpenshiftBaseDependencies
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
def self.
|
33
|
+
def self.install_openshift(options)
|
34
34
|
Vagrant::Action::Builder.new.tap do |b|
|
35
35
|
b.use YumUpdate
|
36
36
|
b.use SetHostName
|
37
|
-
b.use
|
38
|
-
b.use
|
39
|
-
b.use
|
37
|
+
b.use InstallOpenshift
|
38
|
+
b.use InstallOpenshiftRhel7
|
39
|
+
b.use InstallOpenshiftAssetDependencies
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
def self.
|
43
|
+
def self.install_openshift_router(options)
|
44
44
|
Vagrant::Action::Builder.new.tap do |b|
|
45
45
|
b.use RunSystemctl, {:action => "start", :service => "openshift"}
|
46
|
-
b.use
|
46
|
+
b.use InstallOpenshiftRouter
|
47
47
|
b.use RunSystemctl, {:action => "stop", :service => "openshift"}
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
def self.
|
51
|
+
def self.install_openshift_assets_base(options)
|
52
52
|
Vagrant::Action::Builder.new.tap do |b|
|
53
|
-
b.use
|
53
|
+
b.use InstallOpenshiftAssetDependencies
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
def self.
|
57
|
+
def self.build_openshift(options)
|
58
58
|
Vagrant::Action::Builder.new.tap do |b|
|
59
|
-
b.use
|
59
|
+
b.use BuildOpenshift, options
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
def self.
|
63
|
+
def self.push_openshift_images(options)
|
64
64
|
Vagrant::Action::Builder.new.tap do |b|
|
65
|
-
b.use
|
65
|
+
b.use PushOpenshiftImages, options
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
@@ -72,19 +72,19 @@ module Vagrant
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
def self.
|
75
|
+
def self.try_restart_openshift(options)
|
76
76
|
Vagrant::Action::Builder.new.tap do |b|
|
77
77
|
b.use RunSystemctl, {:action => "try-restart", :service => "openshift"}
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
-
def self.
|
81
|
+
def self.build_openshift_base_images(options)
|
82
82
|
Vagrant::Action::Builder.new.tap do |b|
|
83
|
-
b.use
|
83
|
+
b.use BuildOpenshiftBaseImages, options
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
-
def self.
|
87
|
+
def self.repo_sync_openshift(options)
|
88
88
|
Vagrant::Action::Builder.new.tap do |b|
|
89
89
|
b.use PrepareSshConfig
|
90
90
|
if options[:source]
|
@@ -94,11 +94,11 @@ module Vagrant
|
|
94
94
|
end
|
95
95
|
b.use SyncLocalRepository
|
96
96
|
b.use CheckoutRepositories
|
97
|
-
b.use
|
97
|
+
b.use InstallOpenshiftAssetDependencies
|
98
98
|
end
|
99
99
|
if options[:build]
|
100
|
-
b.use(
|
101
|
-
b.use(
|
100
|
+
b.use(BuildOpenshiftBaseImages, options) if options[:images]
|
101
|
+
b.use(BuildOpenshift, options)
|
102
102
|
b.use RunSystemctl, {:action => "try-restart", :service => "openshift"}
|
103
103
|
end
|
104
104
|
end
|
@@ -121,19 +121,19 @@ module Vagrant
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
-
def self.
|
124
|
+
def self.local_openshift_checkout(options)
|
125
125
|
Vagrant::Action::Builder.new.tap do |b|
|
126
126
|
if not options[:no_build]
|
127
|
-
b.use
|
127
|
+
b.use LocalOpenshiftCheckout, options
|
128
128
|
end
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
|
-
def self.
|
132
|
+
def self.run_openshift_tests(options)
|
133
133
|
Vagrant::Action::Builder.new.tap do |b|
|
134
|
-
b.use
|
134
|
+
b.use RunOpenshiftTests, options
|
135
135
|
if options[:download]
|
136
|
-
b.use
|
136
|
+
b.use DownloadArtifactsOpenshift
|
137
137
|
end
|
138
138
|
b.use TestExitCode
|
139
139
|
end
|
@@ -180,9 +180,9 @@ module Vagrant
|
|
180
180
|
end
|
181
181
|
end
|
182
182
|
|
183
|
-
def self.
|
183
|
+
def self.push_openshift_release(options)
|
184
184
|
Vagrant::Action::Builder.new.tap do |b|
|
185
|
-
b.use
|
185
|
+
b.use PushOpenshiftRelease, options
|
186
186
|
end
|
187
187
|
end
|
188
188
|
|
@@ -204,6 +204,26 @@ module Vagrant
|
|
204
204
|
end
|
205
205
|
end
|
206
206
|
|
207
|
+
def self.install_docker_registry
|
208
|
+
Vagrant::Action::Builder.new.tap do |b|
|
209
|
+
b.use InstallDockerRegistry
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
def self.bootstrap_openshift(options)
|
214
|
+
Vagrant::Action::Builder.new.tap do |b|
|
215
|
+
b.use RunSystemctl, {:action => 'restart', :service => 'docker'}
|
216
|
+
b.use BootstrapOpenshift
|
217
|
+
b.use RunSystemctl, {:action => 'enable', :service => 'openshift'}
|
218
|
+
b.use RunSystemctl, {:action => 'start', :service => 'openshift', argv: '--force'}
|
219
|
+
b.use WaitForOpenshift
|
220
|
+
b.use InstallOpenshiftRouter
|
221
|
+
b.use InstallDockerRegistry
|
222
|
+
b.use SetupSamplePolicy
|
223
|
+
b.use CreateSampleProject
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
207
227
|
action_root = Pathname.new(File.expand_path("../action", __FILE__))
|
208
228
|
autoload :Clean, action_root.join("clean")
|
209
229
|
autoload :CloneUpstreamRepositories, action_root.join("clone_upstream_repositories")
|
@@ -212,33 +232,38 @@ module Vagrant
|
|
212
232
|
autoload :SetupBindDnsKey, action_root.join("setup_bind_dns_key")
|
213
233
|
autoload :SetHostName, action_root.join("set_host_name")
|
214
234
|
autoload :YumUpdate, action_root.join("yum_update")
|
215
|
-
autoload :
|
216
|
-
autoload :
|
217
|
-
autoload :
|
218
|
-
autoload :
|
219
|
-
autoload :
|
220
|
-
autoload :
|
221
|
-
autoload :
|
222
|
-
autoload :
|
235
|
+
autoload :InstallOpenshiftBaseDependencies, action_root.join("install_openshift_base_dependencies")
|
236
|
+
autoload :InstallOpenshiftAssetDependencies, action_root.join("install_openshift_asset_dependencies")
|
237
|
+
autoload :BuildOpenshiftBaseImages, action_root.join("build_openshift_base_images")
|
238
|
+
autoload :PushOpenshiftImages, action_root.join("push_openshift_images")
|
239
|
+
autoload :PushOpenshiftRelease, action_root.join("push_openshift_release")
|
240
|
+
autoload :InstallOpenshift, action_root.join("install_openshift")
|
241
|
+
autoload :InstallOpenshiftRhel7, action_root.join("install_openshift_rhel7")
|
242
|
+
autoload :BuildOpenshift, action_root.join("build_openshift")
|
223
243
|
autoload :BuildSti, action_root.join("build_sti")
|
224
244
|
autoload :PrepareSshConfig, action_root.join("prepare_ssh_config")
|
225
245
|
autoload :SyncLocalRepository, action_root.join("sync_local_repository")
|
226
246
|
autoload :SyncUpstreamRepository, action_root.join("sync_upstream_repository")
|
227
|
-
autoload :
|
247
|
+
autoload :LocalOpenshiftCheckout, action_root.join("local_openshift_checkout")
|
228
248
|
autoload :CreateBareRepoPlaceholders, action_root.join("create_bare_repo_placeholders")
|
229
|
-
autoload :
|
249
|
+
autoload :RunOpenshiftTests, action_root.join("run_openshift_tests")
|
230
250
|
autoload :RunStiTests, action_root.join("run_sti_tests")
|
231
251
|
autoload :GenerateTemplate, action_root.join("generate_template")
|
232
252
|
autoload :CreateAMI, action_root.join("create_ami")
|
233
253
|
autoload :ModifyInstance, action_root.join("modify_instance")
|
234
254
|
autoload :ModifyAMI, action_root.join("modify_ami")
|
235
|
-
autoload :
|
255
|
+
autoload :DownloadArtifactsOpenshift, action_root.join("download_artifacts_openshift")
|
236
256
|
autoload :DownloadArtifactsSti, action_root.join("download_artifacts_sti")
|
237
257
|
autoload :TestExitCode, action_root.join("test_exit_code")
|
238
258
|
autoload :CleanNetworkSetup, action_root.join("clean_network_setup")
|
239
259
|
autoload :SetupBindHost, action_root.join("setup_bind_host")
|
240
|
-
autoload :
|
260
|
+
autoload :InstallOpenshiftRouter, action_root.join("install_openshift_router")
|
241
261
|
autoload :RunSystemctl, action_root.join("run_systemctl")
|
262
|
+
autoload :InstallDockerRegistry, action_root.join("install_docker_registry")
|
263
|
+
autoload :WaitForOpenshift, action_root.join("wait_for_openshift")
|
264
|
+
autoload :CreateSampleProject, action_root.join("create_sample_project")
|
265
|
+
autoload :SetupSamplePolicy, action_root.join("setup_sample_policy")
|
266
|
+
autoload :BootstrapOpenshift, action_root.join("bootstrap_openshift")
|
242
267
|
end
|
243
268
|
end
|
244
269
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright 2015 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 BootstrapOpenshift
|
21
|
+
include CommandHelper
|
22
|
+
def initialize(app, env)
|
23
|
+
@app = app
|
24
|
+
@env = env
|
25
|
+
end
|
26
|
+
|
27
|
+
def call(env)
|
28
|
+
do_execute(env[:machine], %q[echo "Bootstrap OpenShift Environment"])
|
29
|
+
@app.call(env)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -27,7 +27,9 @@ module Vagrant
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def call(env)
|
30
|
-
|
30
|
+
ssh_user = env[:machine].ssh_info[:username]
|
31
|
+
|
32
|
+
remote_write(env[:machine], "/#{ssh_user}/.ssh/config", "#{ssh_user}:#{ssh_user}", "0600") {
|
31
33
|
%{Host github.com
|
32
34
|
StrictHostKeyChecking no
|
33
35
|
UserKnownHostsFile=/dev/null
|
@@ -52,7 +54,6 @@ fi
|
|
52
54
|
|
53
55
|
git_clone_commands += "[ -n \"$PIDS\" ] && wait $PIDS\n"
|
54
56
|
|
55
|
-
ssh_user = env[:machine].ssh_info[:username]
|
56
57
|
sudo(env[:machine], "mkdir -p #{Constants.build_dir}")
|
57
58
|
sudo(env[:machine], "mkdir -p #{Constants.build_dir + "builder"} && chown -R #{ssh_user}:#{ssh_user} #{Constants.build_dir}")
|
58
59
|
do_execute env[:machine], git_clone_commands
|
@@ -33,11 +33,27 @@ module Vagrant
|
|
33
33
|
begin
|
34
34
|
machine = env[:aws_compute].servers.get(env[:machine].id)
|
35
35
|
image_req = env[:aws_compute].create_image(machine.identity, machine.tags["Name"], machine.tags["Name"], false)
|
36
|
-
image =
|
36
|
+
image = nil
|
37
|
+
retries = 0
|
38
|
+
while !image && retries < 12
|
39
|
+
image = env[:aws_compute].images.get(image_req.body["imageId"])
|
40
|
+
if image
|
41
|
+
break
|
42
|
+
else
|
43
|
+
retries += 1
|
44
|
+
sleep 5
|
45
|
+
end
|
46
|
+
end
|
37
47
|
env[:machine].ui.info "Creating AMI #{image.id}"
|
38
|
-
|
39
|
-
|
48
|
+
retries = 0
|
49
|
+
while retries < 90
|
40
50
|
image = env[:aws_compute].images.get(image_req.body["imageId"])
|
51
|
+
if image.ready?
|
52
|
+
break
|
53
|
+
else
|
54
|
+
retries += 1
|
55
|
+
sleep 10
|
56
|
+
end
|
41
57
|
end
|
42
58
|
env[:machine].ui.info("Done")
|
43
59
|
rescue Excon::Errors::BadRequest => e
|