vagrant-openshift 1.0.20 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.asciidoc +30 -17
  4. data/lib/vagrant-openshift/action.rb +66 -41
  5. data/lib/vagrant-openshift/action/bootstrap_openshift.rb +34 -0
  6. data/lib/vagrant-openshift/action/{build_openshift3.rb → build_openshift.rb} +1 -1
  7. data/lib/vagrant-openshift/action/{build_openshift3_base_images.rb → build_openshift_base_images.rb} +1 -1
  8. data/lib/vagrant-openshift/action/clone_upstream_repositories.rb +3 -2
  9. data/lib/vagrant-openshift/action/create_ami.rb +19 -3
  10. data/lib/vagrant-openshift/action/create_sample_project.rb +39 -0
  11. data/lib/vagrant-openshift/action/create_yum_repositories.rb +1 -1
  12. data/lib/vagrant-openshift/action/{download_artifacts_openshift3.rb → download_artifacts_openshift.rb} +1 -1
  13. data/lib/vagrant-openshift/action/generate_template.rb +12 -5
  14. data/lib/vagrant-openshift/action/install_docker_registry.rb +47 -0
  15. data/lib/vagrant-openshift/action/{install_openshift3.rb → install_openshift.rb} +7 -5
  16. data/lib/vagrant-openshift/action/{install_openshift3_asset_dependencies.rb → install_openshift_asset_dependencies.rb} +1 -1
  17. data/lib/vagrant-openshift/action/{install_openshift3_base_dependencies.rb → install_openshift_base_dependencies.rb} +2 -2
  18. data/lib/vagrant-openshift/action/{install_openshift3_images.rb → install_openshift_images.rb} +1 -1
  19. data/lib/vagrant-openshift/action/{install_openshift3_rhel7.rb → install_openshift_rhel7.rb} +1 -1
  20. data/lib/vagrant-openshift/action/{install_openshift3_router.rb → install_openshift_router.rb} +3 -3
  21. data/lib/vagrant-openshift/action/{local_openshift3_checkout.rb → local_openshift_checkout.rb} +2 -2
  22. data/lib/vagrant-openshift/action/{push_openshift3_images.rb → push_openshift_images.rb} +3 -3
  23. data/lib/vagrant-openshift/action/{push_openshift3_release.rb → push_openshift_release.rb} +1 -1
  24. data/lib/vagrant-openshift/action/{run_openshift3_tests.rb → run_openshift_tests.rb} +1 -1
  25. data/lib/vagrant-openshift/action/run_systemctl.rb +2 -2
  26. data/lib/vagrant-openshift/action/setup_sample_policy.rb +42 -0
  27. data/lib/vagrant-openshift/action/sync_local_repository.rb +1 -5
  28. data/lib/vagrant-openshift/action/wait_for_openshift.rb +61 -0
  29. data/lib/vagrant-openshift/command/bootstrap_openshift.rb +50 -0
  30. data/lib/vagrant-openshift/command/{build_openshift3.rb → build_openshift.rb} +3 -4
  31. data/lib/vagrant-openshift/command/{build_openshift3_base.rb → build_openshift_base.rb} +3 -4
  32. data/lib/vagrant-openshift/command/{build_openshift3_base_images.rb → build_openshift_base_images.rb} +4 -5
  33. data/lib/vagrant-openshift/command/build_sti.rb +0 -1
  34. data/lib/vagrant-openshift/command/install_docker_registry.rb +50 -0
  35. data/lib/vagrant-openshift/command/{install_openshift3.rb → install_openshift.rb} +4 -5
  36. data/lib/vagrant-openshift/command/{install_openshift3_assets_base.rb → install_openshift_assets_base.rb} +4 -4
  37. data/lib/vagrant-openshift/command/{install_openshift3_router.rb → install_openshift_router.rb} +4 -5
  38. data/lib/vagrant-openshift/command/{local_openshift3_setup.rb → local_openshift_setup.rb} +3 -3
  39. data/lib/vagrant-openshift/command/openshift_init.rb +10 -5
  40. data/lib/vagrant-openshift/command/{push_openshift3_images.rb → push_openshift_images.rb} +4 -4
  41. data/lib/vagrant-openshift/command/{push_openshift3_release.rb → push_openshift_release.rb} +3 -3
  42. data/lib/vagrant-openshift/command/{repo_sync_openshift3.rb → repo_sync_openshift.rb} +3 -3
  43. data/lib/vagrant-openshift/command/{test_openshift3.rb → test_openshift.rb} +3 -3
  44. data/lib/vagrant-openshift/command/{test_openshift3_image.rb → test_openshift_image.rb} +2 -2
  45. data/lib/vagrant-openshift/command/{try_restart_openshift3.rb → try_restart_openshift.rb} +4 -5
  46. data/lib/vagrant-openshift/constants.rb +6 -5
  47. data/lib/vagrant-openshift/helper/command_helper.rb +3 -0
  48. data/lib/vagrant-openshift/plugin.rb +50 -40
  49. data/lib/vagrant-openshift/templates/command/init-openshift/box_info.yaml +42 -2
  50. data/lib/vagrant-openshift/version.rb +1 -1
  51. metadata +35 -28
@@ -0,0 +1,50 @@
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
+ require_relative '../action'
17
+
18
+ module Vagrant
19
+ module Openshift
20
+ module Commands
21
+ class BootstrapOpenshift < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ 'Configures OpenShift with sample project "Turbo"'
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+ options[:clean] = false
31
+
32
+ opts = OptionParser.new do |o|
33
+ o.banner = 'Usage: vagrant bootstrap-openshift [vm-name]'
34
+ o.separator ''
35
+ end
36
+
37
+ # Parse the options
38
+ argv = parse_options(opts)
39
+ return if !argv
40
+
41
+ with_target_vms(argv, :reverse => true) do |machine|
42
+ actions = Vagrant::Openshift::Action.bootstrap_openshift(options)
43
+ @env.action_runner.run actions, {:machine => machine}
44
+ 0
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -18,7 +18,7 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class BuildOpenshift3 < Vagrant.plugin(2, :command)
21
+ class BuildOpenshift < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
@@ -28,12 +28,11 @@ module Vagrant
28
28
  def execute
29
29
  options = {}
30
30
  options[:clean] = false
31
- options[:local_source] = false
32
31
  options[:images] = false
33
32
  options[:force] = false
34
33
 
35
34
  opts = OptionParser.new do |o|
36
- o.banner = "Usage: vagrant build-openshift3 [vm-name]"
35
+ o.banner = "Usage: vagrant build-openshift [vm-name]"
37
36
  o.separator ""
38
37
 
39
38
  o.on("--images", "Build the images as well as core content.") do |c|
@@ -49,7 +48,7 @@ module Vagrant
49
48
  return if !argv
50
49
 
51
50
  with_target_vms(argv, :reverse => true) do |machine|
52
- actions = Vagrant::Openshift::Action.build_openshift3(options)
51
+ actions = Vagrant::Openshift::Action.build_openshift(options)
53
52
  @env.action_runner.run actions, {:machine => machine}
54
53
  0
55
54
  end
@@ -18,7 +18,7 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class BuildOpenshift3Base < Vagrant.plugin(2, :command)
21
+ class BuildOpenshiftBase < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
@@ -28,10 +28,9 @@ module Vagrant
28
28
  def execute
29
29
  options = {}
30
30
  options[:clean] = false
31
- options[:local_source] = false
32
31
 
33
32
  opts = OptionParser.new do |o|
34
- o.banner = "Usage: vagrant build-openshift3-base [vm-name]"
33
+ o.banner = "Usage: vagrant build-openshift-base [vm-name]"
35
34
  o.separator ""
36
35
  end
37
36
 
@@ -40,7 +39,7 @@ module Vagrant
40
39
  return if !argv
41
40
 
42
41
  with_target_vms(argv, :reverse => true) do |machine|
43
- actions = Vagrant::Openshift::Action.build_openshift3_base(options)
42
+ actions = Vagrant::Openshift::Action.build_openshift_base(options)
44
43
  @env.action_runner.run actions, {:machine => machine}
45
44
  0
46
45
  end
@@ -18,20 +18,19 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class BuildOpenshift3BaseImages < Vagrant.plugin(2, :command)
21
+ class BuildOpenshiftBaseImages < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
25
- "builds openshift v3 infrastructure images"
25
+ "builds openshift infrastructure images"
26
26
  end
27
27
 
28
28
  def execute
29
29
  options = {}
30
30
  options[:clean] = false
31
- options[:local_source] = false
32
31
 
33
32
  opts = OptionParser.new do |o|
34
- o.banner = "Usage: vagrant build-openshift3-base-images"
33
+ o.banner = "Usage: vagrant build-openshift-base-images"
35
34
  o.separator ""
36
35
  end
37
36
 
@@ -40,7 +39,7 @@ module Vagrant
40
39
  return if !argv
41
40
 
42
41
  with_target_vms(argv, :reverse => true) do |machine|
43
- actions = Vagrant::Openshift::Action.build_openshift3_base_images(options)
42
+ actions = Vagrant::Openshift::Action.build_openshift_base_images(options)
44
43
  @env.action_runner.run actions, {:machine => machine}
45
44
  0
46
45
  end
@@ -28,7 +28,6 @@ module Vagrant
28
28
  def execute
29
29
  options = {}
30
30
  options[:clean] = false
31
- options[:local_source] = false
32
31
 
33
32
  opts = OptionParser.new do |o|
34
33
  o.banner = "Usage: vagrant build-sti [vm-name]"
@@ -0,0 +1,50 @@
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 InstallDockerRegistry < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "installs docker registry as container"
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+ options[:clean] = false
31
+
32
+ opts = OptionParser.new do |o|
33
+ o.banner = "Usage: vagrant install-docker-registry [vm-name]"
34
+ o.separator ""
35
+ end
36
+
37
+ # Parse the options
38
+ argv = parse_options(opts)
39
+ return if !argv
40
+
41
+ with_target_vms(argv, :reverse => true) do |machine|
42
+ actions = Vagrant::Openshift::Action.install_docker_registry(options)
43
+ @env.action_runner.run actions, {:machine => machine}
44
+ 0
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -18,20 +18,19 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class InstallOpenshift3 < Vagrant.plugin(2, :command)
21
+ class InstallOpenshift < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
25
- "installs openshift3"
25
+ "installs openshift"
26
26
  end
27
27
 
28
28
  def execute
29
29
  options = {}
30
30
  options[:clean] = false
31
- options[:local_source] = false
32
31
 
33
32
  opts = OptionParser.new do |o|
34
- o.banner = "Usage: vagrant install-openshift3 [vm-name]"
33
+ o.banner = "Usage: vagrant install-openshift [vm-name]"
35
34
  o.separator ""
36
35
  end
37
36
 
@@ -40,7 +39,7 @@ module Vagrant
40
39
  return if !argv
41
40
 
42
41
  with_target_vms(argv, :reverse => true) do |machine|
43
- actions = Vagrant::Openshift::Action.install_openshift3(options)
42
+ actions = Vagrant::Openshift::Action.install_openshift(options)
44
43
  @env.action_runner.run actions, {:machine => machine}
45
44
  0
46
45
  end
@@ -18,18 +18,18 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class InstallOpenshift3AssetsBase < Vagrant.plugin(2, :command)
21
+ class InstallOpenshiftAssetsBase < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
25
- "installs openshift3 asset dependencies"
25
+ "installs openshift 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-openshift3-assets-base [vm-name]"
32
+ o.banner = "Usage: vagrant install-openshift-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.install_openshift3_assets_base(options)
41
+ actions = Vagrant::Openshift::Action.install_openshift_assets_base(options)
42
42
  @env.action_runner.run actions, {:machine => machine}
43
43
  0
44
44
  end
@@ -18,20 +18,19 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class InstallOpenshift3Router < Vagrant.plugin(2, :command)
21
+ class InstallOpenshiftRouter < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
25
- "installs openshift3 router"
25
+ "installs openshift router"
26
26
  end
27
27
 
28
28
  def execute
29
29
  options = {}
30
30
  options[:clean] = false
31
- options[:local_source] = false
32
31
 
33
32
  opts = OptionParser.new do |o|
34
- o.banner = "Usage: vagrant install-openshift3-router [vm-name]"
33
+ o.banner = "Usage: vagrant install-openshift-router [vm-name]"
35
34
  o.separator ""
36
35
  end
37
36
 
@@ -40,7 +39,7 @@ module Vagrant
40
39
  return if !argv
41
40
 
42
41
  with_target_vms(argv, :reverse => true) do |machine|
43
- actions = Vagrant::Openshift::Action.install_openshift3_router(options)
42
+ actions = Vagrant::Openshift::Action.install_openshift_router(options)
44
43
  @env.action_runner.run actions, {:machine => machine}
45
44
  0
46
45
  end
@@ -18,7 +18,7 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class LocalOpenshift3Setup < Vagrant.plugin(2, :command)
21
+ class LocalOpenshiftSetup < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
@@ -32,7 +32,7 @@ module Vagrant
32
32
  }
33
33
 
34
34
  opts = OptionParser.new do |o|
35
- o.banner = "Usage: vagrant openshift3-local-checkout [options]"
35
+ o.banner = "Usage: vagrant openshift-local-checkout [options]"
36
36
  o.separator ""
37
37
 
38
38
  o.on("-b [branch-name]", "--branch [branch-name]", String, "Check out the specified branch. Default is 'master'.") do |f|
@@ -52,7 +52,7 @@ module Vagrant
52
52
  argv = parse_options(opts)
53
53
  return if !argv
54
54
 
55
- actions = Vagrant::Openshift::Action.local_openshift3_checkout(options)
55
+ actions = Vagrant::Openshift::Action.local_openshift_checkout(options)
56
56
  @env.action_runner.run actions
57
57
  0
58
58
  end
@@ -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.
@@ -22,7 +22,7 @@ module Vagrant
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
25
- "creates an OpenShift Vagrantfile based on the options supplied"
25
+ "creates an .vagrant-openshift.json config file based on the options supplied"
26
26
  end
27
27
 
28
28
  def execute
@@ -30,17 +30,18 @@ module Vagrant
30
30
  :no_base => false,
31
31
  :os => 'centos7',
32
32
  :stage => 'inst',
33
- :port_mappings => []
33
+ :port_mappings => [],
34
+ :no_synced_folders => false
34
35
  }
35
36
 
36
- valid_stage = ['os','deps','inst']
37
+ valid_stage = ['os','deps','inst', 'bootstrap']
37
38
  valid_os = ['centos7','fedora','rhel7']
38
39
 
39
40
  opts = OptionParser.new do |o|
40
41
  o.banner = "Usage: vagrant origin-init [vm or instance name]"
41
42
  o.separator ""
42
43
 
43
- o.on("-s [stage]", "--stage [stage]", String, "Specify what build state to start from:\n\tos = base operating system\n\tdeps = only dependencies installed\n\tinst = dev environment [default]") do |f|
44
+ o.on("-s [stage]", "--stage [stage]", String, "Specify what build state to start from:\n\tos = base operating system\n\tdeps = only dependencies installed\n\tinst = dev environment [default]\n\tbootstrap = running environment") do |f|
44
45
  options[:stage] = f
45
46
  end
46
47
 
@@ -51,6 +52,10 @@ module Vagrant
51
52
  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
53
  options[:port_mappings].push(f.split(":"))
53
54
  end
55
+
56
+ o.on('--no-synced-folders', 'Checkout source into image rather than mapping from host system') do |f|
57
+ options[:no_synced_folders] = true
58
+ end
54
59
  end
55
60
 
56
61
  # Parse the options
@@ -19,11 +19,11 @@ module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
21
 
22
- class PushOpenshift3Images < Vagrant.plugin(2, :command)
22
+ class PushOpenshiftImages < Vagrant.plugin(2, :command)
23
23
  include CommandHelper
24
24
 
25
25
  def self.synopsis
26
- "build and push openshift v3 images"
26
+ "build and push openshift images"
27
27
  end
28
28
 
29
29
  def execute
@@ -31,7 +31,7 @@ module Vagrant
31
31
  options[:registry] = nil
32
32
 
33
33
  opts = OptionParser.new do |o|
34
- o.banner = "Usage: vagrant push-openshift3-images --registry DOCKER_REGISTRY [vm-name]"
34
+ o.banner = "Usage: vagrant push-openshift-images --registry DOCKER_REGISTRY [vm-name]"
35
35
  o.on("--registry [url]", String, "Docker Registry to push images to.") do |c|
36
36
  options[:registry] = c
37
37
  end
@@ -56,7 +56,7 @@ module Vagrant
56
56
  end
57
57
 
58
58
  with_target_vms(argv, :reverse => true) do |machine|
59
- actions = Vagrant::Openshift::Action.push_openshift3_images(options)
59
+ actions = Vagrant::Openshift::Action.push_openshift_images(options)
60
60
  @env.action_runner.run actions, {:machine => machine}
61
61
  0
62
62
  end
@@ -18,7 +18,7 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class PushOpenshift3Release < Vagrant.plugin(2, :command)
21
+ class PushOpenshiftRelease < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
@@ -29,7 +29,7 @@ module Vagrant
29
29
  options = {}
30
30
 
31
31
  opts = OptionParser.new do |o|
32
- o.banner = "Usage: vagrant push-openshift3-release --registry [registry_name] --include-base [vm-name]"
32
+ o.banner = "Usage: vagrant push-openshift-release --registry [registry_name] --include-base [vm-name]"
33
33
  o.separator ""
34
34
 
35
35
  o.on("--registry [registry_name]", String, "A Docker registry to push images to (include a trailing slash)") do |f|
@@ -46,7 +46,7 @@ module Vagrant
46
46
  return if !argv
47
47
 
48
48
  with_target_vms(argv, :reverse => true) do |machine|
49
- actions = Vagrant::Openshift::Action.push_openshift3_release(options)
49
+ actions = Vagrant::Openshift::Action.push_openshift_release(options)
50
50
  @env.action_runner.run actions, {:machine => machine}
51
51
  0
52
52
  end
@@ -18,7 +18,7 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class RepoSyncOpenshift3 < Vagrant.plugin(2, :command)
21
+ class RepoSyncOpenshift < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
@@ -33,7 +33,7 @@ module Vagrant
33
33
  options[:source] = false
34
34
 
35
35
  opts = OptionParser.new do |o|
36
- o.banner = "Usage: vagrant sync-openshift3 [vm-name]"
36
+ o.banner = "Usage: vagrant sync-openshift [vm-name]"
37
37
  o.separator ""
38
38
 
39
39
  o.on("-s", "--source", "Sync the source (not required if using synced folders)") do |f|
@@ -59,7 +59,7 @@ module Vagrant
59
59
  return if !argv
60
60
 
61
61
  with_target_vms(argv, :reverse => true) do |machine|
62
- actions = Vagrant::Openshift::Action.repo_sync_openshift3(options)
62
+ actions = Vagrant::Openshift::Action.repo_sync_openshift(options)
63
63
  @env.action_runner.run actions, {:machine => machine}
64
64
  0
65
65
  end