vagrant-openshift 2.0.10 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.asciidoc +9 -10
  3. data/lib/vagrant-openshift/action.rb +43 -31
  4. data/lib/vagrant-openshift/action/{build_openshift.rb → build_origin.rb} +4 -4
  5. data/lib/vagrant-openshift/action/{build_openshift_base_images.rb → build_origin_base_images.rb} +1 -1
  6. data/lib/vagrant-openshift/action/clone_upstream_repositories.rb +5 -5
  7. data/lib/vagrant-openshift/action/create_bare_repo_placeholders.rb +4 -4
  8. data/lib/vagrant-openshift/action/create_yum_repositories.rb +3 -1
  9. data/lib/vagrant-openshift/action/{download_artifacts_openshift.rb → download_artifacts_origin.rb} +3 -4
  10. data/lib/vagrant-openshift/action/download_artifacts_sti.rb +1 -1
  11. data/lib/vagrant-openshift/action/generate_template.rb +3 -5
  12. data/lib/vagrant-openshift/action/{install_openshift.rb → install_origin.rb} +1 -1
  13. data/lib/vagrant-openshift/action/{install_openshift_asset_dependencies.rb → install_origin_asset_dependencies.rb} +2 -2
  14. data/lib/vagrant-openshift/action/{install_openshift_base_dependencies.rb → install_origin_base_dependencies.rb} +15 -13
  15. data/lib/vagrant-openshift/action/{install_openshift_rhel7.rb → install_origin_rhel7.rb} +3 -4
  16. data/lib/vagrant-openshift/action/{local_openshift_checkout.rb → local_origin_checkout.rb} +2 -2
  17. data/lib/vagrant-openshift/action/{run_openshift_tests.rb → run_origin_tests.rb} +27 -3
  18. data/lib/vagrant-openshift/action/sync_local_repository.rb +8 -3
  19. data/lib/vagrant-openshift/command/{build_openshift.rb → build_origin.rb} +4 -4
  20. data/lib/vagrant-openshift/command/{build_openshift_base.rb → build_origin_base.rb} +4 -4
  21. data/lib/vagrant-openshift/command/{build_openshift_base_images.rb → build_origin_base_images.rb} +4 -4
  22. data/lib/vagrant-openshift/command/{install_openshift_assets_base.rb → download_artifacts_origin.rb} +4 -4
  23. data/lib/vagrant-openshift/command/download_artifacts_sti.rb +49 -0
  24. data/lib/vagrant-openshift/command/{install_openshift.rb → install_origin.rb} +4 -4
  25. data/lib/vagrant-openshift/command/install_origin_assets_base.rb +49 -0
  26. data/lib/vagrant-openshift/command/{local_openshift_setup.rb → local_origin_setup.rb} +5 -5
  27. data/lib/vagrant-openshift/command/origin_init.rb +4 -4
  28. data/lib/vagrant-openshift/command/{repo_sync_openshift.rb → repo_sync_origin.rb} +3 -3
  29. data/lib/vagrant-openshift/command/{test_openshift.rb → test_origin.rb} +12 -4
  30. data/lib/vagrant-openshift/command/{test_openshift_image.rb → test_origin_image.rb} +2 -2
  31. data/lib/vagrant-openshift/command/{try_restart_openshift.rb → try_restart_origin.rb} +4 -4
  32. data/lib/vagrant-openshift/plugin.rb +40 -35
  33. data/lib/vagrant-openshift/templates/command/init-openshift/box_info.yaml +25 -42
  34. data/lib/vagrant-openshift/version.rb +1 -1
  35. metadata +23 -22
  36. data/lib/vagrant-openshift/command/bootstrap_openshift.rb +0 -50
@@ -17,7 +17,7 @@
17
17
  module Vagrant
18
18
  module Openshift
19
19
  module Action
20
- class InstallOpenshiftRhel7
20
+ class InstallOriginRhel7
21
21
  include CommandHelper
22
22
  def initialize(app, env)
23
23
  @app = app
@@ -47,7 +47,7 @@ rm -rf $contextdir/repos/*chrome*.repo
47
47
 
48
48
  # create Dockerfile
49
49
  cat <<EOF > $contextdir/Dockerfile
50
- FROM registry.access.redhat.com/rhel7:latest
50
+ FROM registry.access.redhat.com/rhel7.1:latest
51
51
 
52
52
  RUN yum remove -y subscription-manager
53
53
 
@@ -59,9 +59,8 @@ RUN yum update -y && yum clean all
59
59
 
60
60
  EOF
61
61
 
62
- # make old official image backup and build the new "official"
63
- docker tag rhel7:latest rhel7:latest_official
64
62
  docker build --rm -t rhel7:latest $contextdir
63
+ docker tag rhel7:latest rhel7.1
65
64
 
66
65
  # cleaning
67
66
  rm -rf $contextdir
@@ -17,7 +17,7 @@
17
17
  module Vagrant
18
18
  module Openshift
19
19
  module Action
20
- class LocalOpenshiftCheckout
20
+ class LocalOriginCheckout
21
21
  include CommandHelper
22
22
 
23
23
  def initialize(app, env, options)
@@ -43,7 +43,7 @@ module Vagrant
43
43
  end
44
44
 
45
45
  system(commands)
46
- puts "OpenShift repositories cloned into #{Dir.pwd}"
46
+ puts "Origin repositories cloned into #{Dir.pwd}"
47
47
  end
48
48
 
49
49
  @app.call(env)
@@ -17,7 +17,7 @@
17
17
  module Vagrant
18
18
  module Openshift
19
19
  module Action
20
- class RunOpenshiftTests
20
+ class RunOriginTests
21
21
  include CommandHelper
22
22
 
23
23
  @@SSH_TIMEOUT = 4800
@@ -68,6 +68,10 @@ popd >/dev/null
68
68
 
69
69
  cmd_env = []
70
70
  build_targets = ["make"]
71
+ if @options[:parallel]
72
+ build_targets << '-j'
73
+ build_targets << '--output-sync=recurse'
74
+ end
71
75
 
72
76
  if @options[:all]
73
77
  cmd_env << 'ARTIFACT_DIR=/tmp/origin/e2e/artifacts'
@@ -83,7 +87,7 @@ popd >/dev/null
83
87
  cmd_env << 'SKIP_IMAGE_CLEANUP=1'
84
88
  end
85
89
  else
86
- build_targets << "check"
90
+ build_targets << "check" if !@options[:skip_check]
87
91
  end
88
92
 
89
93
  if @options[:report_coverage]
@@ -96,7 +100,7 @@ popd >/dev/null
96
100
  if env[:test_exit_code] == 0 && @options[:extended_test_packages].length > 0
97
101
  # for extended tests we need a ginkgo binary
98
102
  do_execute(env[:machine], "go get github.com/onsi/ginkgo/ginkgo", {:timeout => 60*60*2, :fail_on_error => true, :verbose => false})
99
- cmds = @options[:extended_test_packages].split(",").map{ |p| 'test/extended/'+Shellwords.escape(p)+'.sh'}
103
+ cmds = parse_extended(@options[:extended_test_packages])
100
104
  env[:test_exit_code] = run_tests(env, cmds, true)
101
105
  end
102
106
 
@@ -109,6 +113,26 @@ popd >/dev/null
109
113
 
110
114
  @app.call(env)
111
115
  end
116
+
117
+ # parse_extended parses the extended test tag
118
+ # The valid syntax is:
119
+ # [test][extended:core] will run **all** test cases in 'core' bucket
120
+ # [test][extended:core(focus)] will run just test cases that matches 'focus' string in core bucket
121
+ def parse_extended(tag)
122
+ buckets = tag.split(",")
123
+ cmds = []
124
+ buckets.each do |bucket|
125
+ if bucket.include?('(')
126
+ focus = bucket.slice(bucket.index("(")+1..-2).split(" ").map { |i| Shellwords.escape(i.strip) }.join(" ")
127
+ name = Shellwords.escape(bucket.slice(0..bucket.index("(")-1))
128
+ cmds << "test/extended/#{name.strip}.sh -focus=\"#{focus}\""
129
+ else
130
+ cmds << "test/extended/#{Shellwords.escape(bucket.strip)}.sh"
131
+ end
132
+ end
133
+ return cmds
134
+ end
135
+
112
136
  end
113
137
  end
114
138
  end
@@ -63,9 +63,14 @@ module Vagrant
63
63
  command += "git push -q verifier:#{Constants.build_dir + repo_name}-bare master:master --tags --force;\n"
64
64
  end
65
65
  command += "git push -q verifier:#{Constants.build_dir + repo_name }-bare #{branch}:master --tags --force"
66
- system(command)
67
- if $?.exitstatus != 0
68
- exit $?.exitstatus
66
+
67
+ exit_status = 1
68
+ retries = 0
69
+ while exit_status != 0
70
+ system(command)
71
+ exit_status = $?.exitstatus
72
+ exit exit_status if exit_status != 0 && retries >= 2
73
+ retries += 1
69
74
  end
70
75
  ensure
71
76
  reset_temp_commit
@@ -18,11 +18,11 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class BuildOpenshift < Vagrant.plugin(2, :command)
21
+ class BuildOrigin < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
25
- "builds openshift"
25
+ "builds origin"
26
26
  end
27
27
 
28
28
  def execute
@@ -32,7 +32,7 @@ module Vagrant
32
32
  options[:force] = false
33
33
 
34
34
  opts = OptionParser.new do |o|
35
- o.banner = "Usage: vagrant build-openshift [vm-name]"
35
+ o.banner = "Usage: vagrant build-origin [vm-name]"
36
36
  o.separator ""
37
37
 
38
38
  o.on("--images", "Build the images as well as core content.") do |c|
@@ -48,7 +48,7 @@ module Vagrant
48
48
  return if !argv
49
49
 
50
50
  with_target_vms(argv, :reverse => true) do |machine|
51
- actions = Vagrant::Openshift::Action.build_openshift(options)
51
+ actions = Vagrant::Openshift::Action.build_origin(options)
52
52
  @env.action_runner.run actions, {:machine => machine}
53
53
  0
54
54
  end
@@ -18,11 +18,11 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class BuildOpenshiftBase < Vagrant.plugin(2, :command)
21
+ class BuildOriginBase < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
25
- "install the prereqs for openshift"
25
+ "install the prereqs for origin"
26
26
  end
27
27
 
28
28
  def execute
@@ -30,7 +30,7 @@ module Vagrant
30
30
  options[:clean] = false
31
31
 
32
32
  opts = OptionParser.new do |o|
33
- o.banner = "Usage: vagrant build-openshift-base [vm-name]"
33
+ o.banner = "Usage: vagrant build-origin-base [vm-name]"
34
34
  o.separator ""
35
35
  end
36
36
 
@@ -39,7 +39,7 @@ module Vagrant
39
39
  return if !argv
40
40
 
41
41
  with_target_vms(argv, :reverse => true) do |machine|
42
- actions = Vagrant::Openshift::Action.build_openshift_base(options)
42
+ actions = Vagrant::Openshift::Action.build_origin_base(options)
43
43
  @env.action_runner.run actions, {:machine => machine}
44
44
  0
45
45
  end
@@ -18,11 +18,11 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class BuildOpenshiftBaseImages < Vagrant.plugin(2, :command)
21
+ class BuildOriginBaseImages < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
25
- "builds openshift infrastructure images"
25
+ "builds origin infrastructure images"
26
26
  end
27
27
 
28
28
  def execute
@@ -30,7 +30,7 @@ module Vagrant
30
30
  options[:clean] = false
31
31
 
32
32
  opts = OptionParser.new do |o|
33
- o.banner = "Usage: vagrant build-openshift-base-images"
33
+ o.banner = "Usage: vagrant build-origin-base-images"
34
34
  o.separator ""
35
35
  end
36
36
 
@@ -39,7 +39,7 @@ module Vagrant
39
39
  return if !argv
40
40
 
41
41
  with_target_vms(argv, :reverse => true) do |machine|
42
- actions = Vagrant::Openshift::Action.build_openshift_base_images(options)
42
+ actions = Vagrant::Openshift::Action.build_origin_base_images(options)
43
43
  @env.action_runner.run actions, {:machine => machine}
44
44
  0
45
45
  end
@@ -18,18 +18,18 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class InstallOpenshiftAssetsBase < Vagrant.plugin(2, :command)
21
+ class DownloadArtifactsOrigin < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
25
- "installs openshift asset dependencies"
25
+ "download the origin test artifacts"
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-openshift-assets-base [vm-name]"
32
+ o.banner = "Usage: vagrant download-artifacts-origin [machine-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_openshift_assets_base(options)
41
+ actions = Vagrant::Openshift::Action.download_origin_artifacts(options)
42
42
  @env.action_runner.run actions, {:machine => machine}
43
43
  0
44
44
  end
@@ -0,0 +1,49 @@
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 DownloadArtifactsSti < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "download the origin test artifacts"
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+
31
+ opts = OptionParser.new do |o|
32
+ o.banner = "Usage: vagrant download-artifacts-sti [machine-name]"
33
+ o.separator ""
34
+ end
35
+
36
+ # Parse the options
37
+ argv = parse_options(opts)
38
+ return if !argv
39
+
40
+ with_target_vms(argv, :reverse => true) do |machine|
41
+ actions = Vagrant::Openshift::Action.download_sti_artifacts(options)
42
+ @env.action_runner.run actions, {:machine => machine}
43
+ 0
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -18,11 +18,11 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class InstallOpenshift < Vagrant.plugin(2, :command)
21
+ class InstallOrigin < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
25
- "installs openshift"
25
+ "installs origin"
26
26
  end
27
27
 
28
28
  def execute
@@ -30,7 +30,7 @@ module Vagrant
30
30
  options[:clean] = false
31
31
 
32
32
  opts = OptionParser.new do |o|
33
- o.banner = "Usage: vagrant install-openshift [vm-name]"
33
+ o.banner = "Usage: vagrant install-origin [vm-name]"
34
34
  o.separator ""
35
35
  end
36
36
 
@@ -39,7 +39,7 @@ module Vagrant
39
39
  return if !argv
40
40
 
41
41
  with_target_vms(argv, :reverse => true) do |machine|
42
- actions = Vagrant::Openshift::Action.install_openshift(options)
42
+ actions = Vagrant::Openshift::Action.install_origin(options)
43
43
  @env.action_runner.run actions, {:machine => machine}
44
44
  0
45
45
  end
@@ -0,0 +1,49 @@
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 InstallOriginAssetsBase < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "installs origin asset dependencies"
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+
31
+ opts = OptionParser.new do |o|
32
+ o.banner = "Usage: vagrant install-origin-assets-base [vm-name]"
33
+ o.separator ""
34
+ end
35
+
36
+ # Parse the options
37
+ argv = parse_options(opts)
38
+ return if !argv
39
+
40
+ with_target_vms(argv, :reverse => true) do |machine|
41
+ actions = Vagrant::Openshift::Action.install_origin_assets_base(options)
42
+ @env.action_runner.run actions, {:machine => machine}
43
+ 0
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -18,11 +18,11 @@ require_relative "../action"
18
18
  module Vagrant
19
19
  module Openshift
20
20
  module Commands
21
- class LocalOpenshiftSetup < Vagrant.plugin(2, :command)
21
+ class LocalOriginSetup < Vagrant.plugin(2, :command)
22
22
  include CommandHelper
23
23
 
24
24
  def self.synopsis
25
- "clones the openshift repos into the current directory"
25
+ "clones the origin repos into the current directory"
26
26
  end
27
27
 
28
28
  def execute
@@ -32,14 +32,14 @@ module Vagrant
32
32
  }
33
33
 
34
34
  opts = OptionParser.new do |o|
35
- o.banner = "Usage: vagrant openshift-local-checkout [options]"
35
+ o.banner = "Usage: vagrant origin-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|
39
39
  options[:branch] = f
40
40
  end
41
41
 
42
- o.on("-u [username]", "--user [username]", String, "Your GitHub username. If provided, Vagrant will attempt to clone your forks of the Origin repos. If not provided, or if the forks cannot be found, Vagrant will clone read-only copies of the OpenShift repos.") do |f|
42
+ o.on("-u [username]", "--user [username]", String, "Your GitHub username. If provided, Vagrant will attempt to clone your forks of the Origin repos. If not provided, or if the forks cannot be found, Vagrant will clone read-only copies of the Origin repos.") do |f|
43
43
  options[:user] = f
44
44
  end
45
45
 
@@ -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_openshift_checkout(options)
55
+ actions = Vagrant::Openshift::Action.local_origin_checkout(options)
56
56
  @env.action_runner.run actions
57
57
  0
58
58
  end
@@ -37,18 +37,18 @@ module Vagrant
37
37
  :no_insert_key => false
38
38
  }
39
39
 
40
- valid_stage = ['os','deps','inst', 'bootstrap']
41
- valid_os = ['centos7','fedora','rhel7','rhelatomic7']
40
+ valid_stage = ['os','deps','inst']
41
+ valid_os = ['centos7','fedora','rhel7','rhel7next','rhelatomic7']
42
42
 
43
43
  opts = OptionParser.new do |o|
44
44
  o.banner = "Usage: vagrant origin-init [vm or instance name]"
45
45
  o.separator ""
46
46
 
47
- 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|
47
+ 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|
48
48
  options[:stage] = f
49
49
  end
50
50
 
51
- o.on("-o [name]", "--os [name]", String, "Operating system:\n\tcentos7 [default]\n\tfedora\n\trhel7\n\trhelatomic7") do |f|
51
+ o.on("-o [name]", "--os [name]", String, "Operating system:\n\tcentos7 [default]\n\tfedora\n\trhel7\n\trhel7next\n\trhelatomic7") do |f|
52
52
  options[:os] = f
53
53
  end
54
54