vagrant-openshift 3.0.8 → 3.0.9

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +6 -1
  3. data/Gemfile +5 -1
  4. data/README.asciidoc +65 -78
  5. data/hack/test.sh +135 -0
  6. data/hack/update.sh +32 -0
  7. data/lib/vagrant-openshift.rb +1 -0
  8. data/lib/vagrant-openshift/action.rb +83 -12
  9. data/lib/vagrant-openshift/action/build_origin_images.rb +2 -2
  10. data/lib/vagrant-openshift/action/create_yum_repositories.rb +1 -1
  11. data/lib/vagrant-openshift/action/download_artifacts_origin_console.rb +2 -2
  12. data/lib/vagrant-openshift/action/download_artifacts_origin_metrics.rb +67 -0
  13. data/lib/vagrant-openshift/action/install_docker.rb +54 -0
  14. data/lib/vagrant-openshift/action/install_golang.rb +52 -0
  15. data/lib/vagrant-openshift/action/install_origin_asset_dependencies.rb +6 -3
  16. data/lib/vagrant-openshift/action/install_origin_base_dependencies.rb +22 -237
  17. data/lib/vagrant-openshift/action/install_origin_rhel7.rb +29 -6
  18. data/lib/vagrant-openshift/action/push_openshift_images.rb +26 -37
  19. data/lib/vagrant-openshift/action/run_customer_diagnostics_tests.rb +79 -0
  20. data/lib/vagrant-openshift/action/run_origin_asset_tests.rb +1 -3
  21. data/lib/vagrant-openshift/action/run_origin_metrics_tests.rb +83 -0
  22. data/lib/vagrant-openshift/action/run_origin_tests.rb +9 -4
  23. data/lib/vagrant-openshift/command/checkout_repositories.rb +1 -3
  24. data/lib/vagrant-openshift/command/create_local_yum_repo.rb +2 -2
  25. data/lib/vagrant-openshift/command/download_artifacts_origin_metrics.rb +49 -0
  26. data/lib/vagrant-openshift/command/install_docker.rb +68 -0
  27. data/lib/vagrant-openshift/command/install_golang.rb +68 -0
  28. data/lib/vagrant-openshift/command/repo_sync_customer_diagnostics.rb +71 -0
  29. data/lib/vagrant-openshift/command/repo_sync_origin_metrics.rb +71 -0
  30. data/lib/vagrant-openshift/command/test_customer_diagnostics.rb +69 -0
  31. data/lib/vagrant-openshift/command/test_origin_image.rb +1 -1
  32. data/lib/vagrant-openshift/command/test_origin_metrics.rb +67 -0
  33. data/lib/vagrant-openshift/constants.rb +8 -2
  34. data/lib/vagrant-openshift/helper/command_helper.rb +63 -39
  35. data/lib/vagrant-openshift/helper/install_helper.rb +139 -0
  36. data/lib/vagrant-openshift/plugin.rb +37 -2
  37. data/lib/vagrant-openshift/resources/configure_docker.sh +53 -0
  38. data/lib/vagrant-openshift/resources/configure_system.sh +23 -0
  39. data/lib/vagrant-openshift/resources/install_chrome.sh +22 -0
  40. data/lib/vagrant-openshift/resources/install_dependencies.sh +58 -0
  41. data/lib/vagrant-openshift/resources/install_nonessential.sh +6 -0
  42. data/lib/vagrant-openshift/resources/install_rhaos_repos.sh +11 -0
  43. data/lib/vagrant-openshift/resources/reconfigure_network_fedora.sh +13 -0
  44. data/lib/vagrant-openshift/resources/rhaos31.repo +13 -0
  45. data/lib/vagrant-openshift/resources/rhaos32.repo +13 -0
  46. data/lib/vagrant-openshift/resources/rhaos33.repo +13 -0
  47. data/lib/vagrant-openshift/resources/rhaos34.repo +13 -0
  48. data/lib/vagrant-openshift/version.rb +1 -1
  49. metadata +29 -3
@@ -37,14 +37,14 @@ set -ex
37
37
  contextdir=$(mktemp -d)
38
38
 
39
39
  # copy the necessary files
40
- mkdir $contextdir/{certs,repos,vars}
40
+ mkdir $contextdir/{certs,repos,vars,keys}
41
41
  cp /var/lib/yum/*.pem $contextdir/certs
42
42
  cp /etc/yum/vars/* $contextdir/vars
43
43
  cp /etc/yum.repos.d/* $contextdir/repos
44
+ cp /etc/pki/rpm-gpg/* $contextdir/keys
44
45
 
45
- # yum magic that auto-replaces REGION in repos doesn't work
46
- # when running inside a docker container, so harcode the value.
47
- sed -i s/REGION.aws.ce.redhat.com/us-east-1.aws.ce.redhat.com/ $contextdir/repos/redhat-rhui*
46
+ # Remove repositories we won't be needing and which require RH certs
47
+ rm -rf $contextdir/repos/redhat-rhui*
48
48
 
49
49
  # remove google chrome repo
50
50
  rm -rf $contextdir/repos/*chrome*.repo
@@ -58,6 +58,7 @@ RUN yum remove -y subscription-manager
58
58
  ADD vars/* /etc/yum/vars/
59
59
  ADD repos/* /etc/yum.repos.d/
60
60
  ADD certs/* /var/lib/yum/
61
+ ADD keys/* /etc/pki/rpm-gpg/
61
62
 
62
63
  # we're picking up 7.2 packages in our 7.1 image and these two conflict, so
63
64
  # first replace the 7.1 package with the new 7.2 package so later updates/dep
@@ -68,8 +69,7 @@ RUN yum update -y && yum clean all
68
69
 
69
70
  EOF
70
71
 
71
- docker build --rm -t rhel7:latest $contextdir
72
- docker tag rhel7:latest rhel7.1
72
+ docker build --rm -t rhel7.1 $contextdir
73
73
 
74
74
  # create Dockerfile
75
75
  cat <<EOF > $contextdir/Dockerfile
@@ -80,6 +80,7 @@ RUN yum remove -y subscription-manager
80
80
  ADD vars/* /etc/yum/vars/
81
81
  ADD repos/* /etc/yum.repos.d/
82
82
  ADD certs/* /var/lib/yum/
83
+ ADD keys/* /etc/pki/rpm-gpg/
83
84
 
84
85
  RUN yum update -y && yum clean all
85
86
 
@@ -90,6 +91,28 @@ docker build --rm -t rhel7.2 $contextdir
90
91
  # make sure the new rhel7.2 image has valid certs
91
92
  docker run rhel7.2 yum install -y tar
92
93
 
94
+ # create Dockerfile
95
+ cat <<EOF > $contextdir/Dockerfile
96
+ FROM registry.access.redhat.com/rhel7.3:latest
97
+
98
+ RUN yum remove -y subscription-manager
99
+
100
+ ADD vars/* /etc/yum/vars/
101
+ ADD repos/* /etc/yum.repos.d/
102
+ ADD certs/* /var/lib/yum/
103
+ ADD keys/* /etc/pki/rpm-gpg/
104
+
105
+ RUN yum update -y && yum clean all
106
+
107
+ EOF
108
+
109
+ docker build --rm -t rhel7.3 $contextdir
110
+
111
+ # make sure the new rhel7.3 image has valid certs
112
+ docker run rhel7.3 yum install -y tar
113
+
114
+ docker tag rhel7.3 rhel7
115
+
93
116
  # cleaning
94
117
  rm -rf $contextdir
95
118
  })
@@ -32,7 +32,7 @@ module Vagrant
32
32
  %{
33
33
  sudo chmod a+rw /etc/sysconfig/docker
34
34
  cat <<EOF > /etc/sysconfig/docker
35
- OPTIONS='--insecure-registry #{registry_url} --selinux-enabled'
35
+ OPTIONS='--insecure-registry #{registry_url} --selinux-enabled --skip-schema2-push'
36
36
  EOF
37
37
  sudo systemctl restart docker
38
38
  }
@@ -47,20 +47,14 @@ git checkout #{git_ref}
47
47
  git_ref=$(git rev-parse --short HEAD)
48
48
  echo "Pushing image #{image_name}:#{git_ref}..."
49
49
 
50
- docker tag -f #{centos_namespace}/#{image_name}-centos7 #{registry}#{centos_namespace}/#{image_name}-centos7:#{git_ref}
51
- docker tag -f #{centos_namespace}/#{image_name}-centos7 #{registry}#{centos_namespace}/#{image_name}-centos7:latest
52
- docker tag -f #{centos_namespace}/#{image_name}-centos7 docker.io/#{centos_namespace}/#{image_name}-centos7:latest
53
- docker tag -f #{rhel_namespace}/#{image_name}-rhel7 #{registry}#{rhel_namespace}/#{image_name}-rhel7:#{git_ref}
54
- docker tag -f #{rhel_namespace}/#{image_name}-rhel7 #{registry}#{rhel_namespace}/#{image_name}-rhel7:latest
50
+ docker tag #{centos_namespace}/#{image_name}-centos7 #{registry}#{centos_namespace}/#{image_name}-centos7:#{git_ref}
51
+ docker tag #{centos_namespace}/#{image_name}-centos7 #{registry}#{centos_namespace}/#{image_name}-centos7:latest
52
+ docker tag #{centos_namespace}/#{image_name}-centos7 docker.io/#{centos_namespace}/#{image_name}-centos7:latest
55
53
 
56
54
  # We can't fully parallelize this because docker fails when you push to the same repo at the
57
55
  # same time (using different tags), so we do two groups of push operations.
58
- # this one is failing in parallel for unknown reasons
59
- docker push #{registry}#{rhel_namespace}/#{image_name}-rhel7:#{git_ref}
60
-
61
56
  procs[0]="docker push #{registry}#{centos_namespace}/#{image_name}-centos7:#{git_ref}"
62
57
  procs[1]="docker push docker.io/#{centos_namespace}/#{image_name}-centos7:latest"
63
- #procs[2]="docker push #{registry}#{rhel_namespace}/#{image_name}-rhel7:#{git_ref}"
64
58
 
65
59
  # Run pushes in parallel
66
60
  for i in {0..1}; do
@@ -76,19 +70,16 @@ for pid in ${pids[*]}; do
76
70
  wait $pid
77
71
  done
78
72
 
79
- procs[0]="docker push #{registry}#{centos_namespace}/#{image_name}-centos7:latest"
80
- procs[1]="docker push #{registry}#{rhel_namespace}/#{image_name}-rhel7:latest"
73
+ docker push #{registry}#{centos_namespace}/#{image_name}-centos7:latest
81
74
 
82
- # Run pushes in parallel
83
- for i in {0..1}; do
84
- ${procs[${i}]} &
85
- pids[${i}]=$!
86
- done
75
+ if [ #{rhel_namespace} != "SKIP" ]; then
76
+ docker tag #{rhel_namespace}/#{image_name}-rhel7 #{registry}#{rhel_namespace}/#{image_name}-rhel7:#{git_ref}
77
+ docker tag #{rhel_namespace}/#{image_name}-rhel7 #{registry}#{rhel_namespace}/#{image_name}-rhel7:latest
87
78
 
88
- # Wait for all pushes. "wait" will check the return code of each process also.
89
- for pid in ${pids[*]}; do
90
- wait $pid
91
- done
79
+ # this one is failing when done in parallel for unknown reasons
80
+ docker push #{registry}#{rhel_namespace}/#{image_name}-rhel7:#{git_ref}
81
+ docker push #{registry}#{rhel_namespace}/#{image_name}-rhel7:latest
82
+ fi
92
83
 
93
84
  popd
94
85
  set +e
@@ -113,20 +104,24 @@ git_ref=$(git rev-parse --short HEAD)
113
104
  echo "Building and testing #{image_name}-centos7:$git_ref ..."
114
105
  sudo env "PATH=$PATH" SKIP_SQUASH=1 make test TARGET=centos7 VERSION=#{version} TAG_ON_SUCCESS=true
115
106
  echo "Building and testing #{image_name}-rhel7:$git_ref ..."
116
- sudo env "PATH=$PATH" SKIP_SQUASH=1 make test TARGET=rhel7 VERSION=#{version} TAG_ON_SUCCESS=true
107
+ sudo env "PATH=$PATH" SKIP_SQUASH=1 SKIP_RHEL_SCL=1 make test TARGET=rhel7 VERSION=#{version} TAG_ON_SUCCESS=true
108
+
117
109
  popd
118
110
  set +e
119
111
  }
120
112
  end
121
113
 
122
114
  def check_latest_image_cmd(registry,namespace,name,git_url)
123
- cmd = %{
124
- git_ref=$(git ls-remote #{git_url} -h refs/heads/master | cut -c1-7)
125
- curl -s http://#{registry}v1/repositories/#{namespace}/#{name}-rhel7/tags/${git_ref} | grep -q "error"
126
- if [[ "$?" != "0" ]]; then
127
- echo "#{name};$git_ref" >> ~/latest_images
128
- fi
115
+ cmd = ""
116
+ if $namespace!="SKIP"
117
+ cmd = %{
118
+ git_ref=$(git ls-remote #{git_url} -h refs/heads/master | cut -c1-7)
119
+ curl -s http://#{registry}v1/repositories/#{namespace}/#{name}-centos7/tags/${git_ref} | grep -q "error"
120
+ if [[ "$?" != "0" ]]; then
121
+ echo "#{name};$git_ref" >> ~/latest_images
122
+ fi
129
123
  }
124
+ end
130
125
  return cmd
131
126
  end
132
127
 
@@ -141,9 +136,9 @@ set -x
141
136
  set +e
142
137
  echo "Pre-pulling base images ..."
143
138
  docker pull #{@options[:registry]}openshift/base-centos7
144
- [[ "$?" == "0" ]] && docker tag -f #{@options[:registry]}openshift/base-centos7 openshift/base-centos7
139
+ [[ "$?" == "0" ]] && docker tag #{@options[:registry]}openshift/base-centos7 openshift/base-centos7
145
140
  docker pull #{@options[:registry]}openshift/base-rhel7
146
- [[ "$?" == "0" ]] && docker tag -f #{@options[:registry]}openshift/base-rhel7 openshift/base-rhel7
141
+ [[ "$?" == "0" ]] && docker tag #{@options[:registry]}openshift/base-rhel7 openshift/base-rhel7
147
142
  }
148
143
 
149
144
  cmd += %{
@@ -151,12 +146,6 @@ docker pull #{@options[:registry]}openshift/base-rhel7
151
146
  export PATH=/data/src/github.com/openshift/source-to-image/_output/local/go/bin:/data/src/github.com/openshift/source-to-image/_output/local/bin/linux/amd64:$PATH
152
147
  }
153
148
 
154
- # FIXME: We always need to make sure we have the latest base image
155
- # FIXME: This is because the internal registry is pruned once per month
156
- if !@options[:build_images].include?("base")
157
- @options[:build_images] = "openshift;openshift;base;1;https://github.com/openshift/sti-base;master,#{@options[:build_images]}"
158
- end
159
-
160
149
  build_images = @options[:build_images].split(",").map { |i| i.strip }
161
150
 
162
151
  push_cmd = ""
@@ -177,7 +166,7 @@ export PATH=/data/src/github.com/openshift/source-to-image/_output/local/go/bin:
177
166
  check_images = @options[:check_images].split(",").map { |i| i.strip }
178
167
  check_images.each do |image|
179
168
  centos_namespace,rhel_namespace,name, version, repo_url, git_ref = image.split(';')
180
- cmd+= check_latest_image_cmd(@options[:registry],rhel_namespace,name,repo_url)
169
+ cmd+= check_latest_image_cmd(@options[:registry],centos_namespace,name,repo_url)
181
170
  end
182
171
 
183
172
  do_execute(env[:machine], cmd, :timeout=>60*60*5)
@@ -0,0 +1,79 @@
1
+ #--
2
+ # Copyright 2016 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 RunCustomerDiagnosticsTests
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 run_tests(env, cmds, as_root=true)
32
+ tests = ''
33
+ cmds.each do |cmd|
34
+ tests += "
35
+ echo '***************************************************'
36
+ echo 'Running #{cmd}...'
37
+ time #{cmd}
38
+ echo 'Finished #{cmd}'
39
+ echo '***************************************************'
40
+ "
41
+ end
42
+ cmd = %{
43
+ set -e
44
+ pushd #{Constants.build_dir}/openshift-ansible/ >/dev/null
45
+ export PATH=$GOPATH/bin:$PATH
46
+ #{tests}
47
+ popd >/dev/null
48
+ }
49
+ exit_code = 0
50
+ if as_root
51
+ _,_,exit_code = sudo(env[:machine], cmd, {:timeout => 60*60*4, :fail_on_error => false, :verbose => false})
52
+ else
53
+ _,_,exit_code = do_execute(env[:machine], cmd, {:timeout => 60*60*4, :fail_on_error => false, :verbose => false})
54
+ end
55
+ exit_code
56
+ end
57
+
58
+ #
59
+ # All env vars will be added to the beginning of the command like VAR=1 make test
60
+ #
61
+ def call(env)
62
+ @options.delete :logs
63
+
64
+ cmd_env = []
65
+
66
+ if @options[:envs]
67
+ cmd_env += @options[:envs]
68
+ end
69
+
70
+ cmd_env << "make #{@options[:target]}"
71
+ cmd = cmd_env.join(' ')
72
+ env[:test_exit_code] = run_tests(env, [cmd], @options[:root])
73
+
74
+ @app.call(env)
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
@@ -67,9 +67,7 @@ popd >/dev/null
67
67
  cmds += @options[:envs]
68
68
  end
69
69
 
70
- cmds << 'hack/verify-dist.sh'
71
- cmds << 'grunt test'
72
- cmds << 'hack/test-integration-headless.sh'
70
+ cmds << 'make test -o build'
73
71
  cmd = cmds.join(' ')
74
72
  env[:test_exit_code] = run_tests(env, cmds, @options[:root])
75
73
 
@@ -0,0 +1,83 @@
1
+ #--
2
+ # Copyright 2016 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 RunOriginMetricsTests
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 run_tests(env, cmds, as_root=true)
32
+ tests = ''
33
+ cmds.each do |cmd|
34
+ tests += "
35
+ echo '***************************************************'
36
+ echo 'Running #{cmd}...'
37
+ time #{cmd}
38
+ echo 'Finished #{cmd}'
39
+ echo '***************************************************'
40
+ "
41
+ end
42
+ cmd = %{
43
+ set -e
44
+ pushd #{Constants.build_dir}/origin-metrics/hack/tests >/dev/null
45
+ export PATH=$GOPATH/bin:$PATH
46
+ #{tests}
47
+ popd >/dev/null
48
+ }
49
+ exit_code = 0
50
+ if as_root
51
+ _,_,exit_code = sudo(env[:machine], cmd, {:timeout => 60*60*4, :fail_on_error => false, :verbose => false})
52
+ else
53
+ _,_,exit_code = do_execute(env[:machine], cmd, {:timeout => 60*60*4, :fail_on_error => false, :verbose => false})
54
+ end
55
+ exit_code
56
+ end
57
+
58
+ #
59
+ # All env vars will be added to the beginning of the command like VAR=1 make test
60
+ #
61
+ def call(env)
62
+ @options.delete :logs
63
+
64
+ cmd_env = []
65
+
66
+ if @options[:envs]
67
+ cmd_env += @options[:envs]
68
+ end
69
+
70
+ if @options[:image_registry]
71
+ cmd_env << "OPENSHIFT_TEST_IMAGE_REGISTRY=#{@options[:image_registry]}"
72
+ end
73
+
74
+ cmd_env << './ci_test_every_pr.sh'
75
+ cmd = cmd_env.join(' ')
76
+ env[:test_exit_code] = run_tests(env, [cmd], @options[:root])
77
+
78
+ @app.call(env)
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
@@ -48,9 +48,9 @@ popd >/dev/null
48
48
  }
49
49
  exit_code = 0
50
50
  if as_root
51
- _,_,exit_code = sudo(env[:machine], cmd, {:timeout => 60*60*4, :fail_on_error => false, :verbose => false})
51
+ _,_,exit_code = sudo(env[:machine], cmd, {:timeout => 60*60*12, :fail_on_error => false, :verbose => false})
52
52
  else
53
- _,_,exit_code = do_execute(env[:machine], cmd, {:timeout => 60*60*4, :fail_on_error => false, :verbose => false})
53
+ _,_,exit_code = do_execute(env[:machine], cmd, {:timeout => 60*60*12, :fail_on_error => false, :verbose => false})
54
54
  end
55
55
  exit_code
56
56
  end
@@ -116,6 +116,11 @@ popd >/dev/null
116
116
  if @options[:image_registry]
117
117
  extended_cmd_env << "OPENSHIFT_TEST_IMAGE_REGISTRY=#{@options[:image_registry]}"
118
118
  end
119
+
120
+ if @options[:envs]
121
+ extended_cmd_env += @options[:envs]
122
+ end
123
+
119
124
  extended_cmd_env_str = extended_cmd_env.join(' ')
120
125
 
121
126
  cmds = cmds.map{ |s| "#{extended_cmd_env_str} #{s}".strip }
@@ -134,8 +139,8 @@ popd >/dev/null
134
139
  cmds = []
135
140
  buckets.each do |bucket|
136
141
  if bucket.include?('(')
137
- focus = bucket.slice(bucket.index("(")+1..-2).split(" ").map { |i| Shellwords.escape(i.strip) }.join(" ")
138
- name = Shellwords.escape(bucket.slice(0..bucket.index("(")-1))
142
+ focus = bucket.slice(bucket.index("(")+1..-2).split(" ").map { |i| i.strip }.join(" ")
143
+ name = bucket.slice(0..bucket.index("(")-1)
139
144
  cmds << "test/extended/#{name.strip}.sh --ginkgo.focus=\"#{focus}\""
140
145
  else
141
146
  cmds << "test/extended/#{Shellwords.escape(bucket.strip)}.sh"
@@ -33,15 +33,13 @@ module Vagrant
33
33
  o.banner = "Usage: vagrant checkout-repos"
34
34
  o.separator ""
35
35
 
36
- o.on("-b [branch-name]", "--branch [branch-name]", String, "Check out the specified branch. Default is 'master'.") do |f|
36
+ o.on("-b [branch-name]", "--branch [branch-name]", String, "Check out the specified branch. If unset, no checkout happens and the default branch is used (e.g. master).") do |f|
37
37
  options[:branch] = {"origin-server" => f}
38
38
  end
39
39
 
40
40
  o.on("-r [repo-name]", "--repo [repo-name]", String, "Check out the specified repo. Default is 'origin'.") do |f|
41
41
  options[:repo] = f
42
42
  end
43
-
44
- #@options[:branch][repo_name]
45
43
  end
46
44
 
47
45
  # Parse the options
@@ -33,11 +33,11 @@ module Vagrant
33
33
  opts = OptionParser.new do |o|
34
34
  o.banner = "Usage: vagrant create-local-yum-repo [vm-name]"
35
35
  o.separator ""
36
-
36
+
37
37
  o.on("--rpmdir_loc [directory]", String, "Directory where the RPMs exist on the vm.") do |f|
38
38
  options[:rpmdir_loc] = f
39
39
  end
40
-
40
+
41
41
  end
42
42
 
43
43
  # Parse the options
@@ -0,0 +1,49 @@
1
+ #--
2
+ # Copyright 2016 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 DownloadArtifactsOriginMetrics < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "download the origin-metrics test artifacts"
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+
31
+ opts = OptionParser.new do |o|
32
+ o.banner = "Usage: vagrant download-artifacts-origin-metrics [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_origin_metrics_artifacts(options)
42
+ @env.action_runner.run actions, {:machine => machine}
43
+ 0
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end