vagrant-openshift 3.0.3 → 3.0.4

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.asciidoc +50 -0
  3. data/lib/vagrant-openshift/action/build_origin_base_images.rb +1 -1
  4. data/lib/vagrant-openshift/action/build_origin_images.rb +60 -0
  5. data/lib/vagrant-openshift/action/build_origin_rpm_test.rb +51 -0
  6. data/lib/vagrant-openshift/action/checkout_repositories.rb +1 -1
  7. data/lib/vagrant-openshift/action/clean.rb +3 -2
  8. data/lib/vagrant-openshift/action/clone_upstream_repositories.rb +1 -1
  9. data/lib/vagrant-openshift/action/create_local_yum_repo.rb +54 -0
  10. data/lib/vagrant-openshift/action/download_artifacts_origin.rb +6 -5
  11. data/lib/vagrant-openshift/action/download_artifacts_origin_aggregated_logging.rb +67 -0
  12. data/lib/vagrant-openshift/action/generate_template.rb +0 -4
  13. data/lib/vagrant-openshift/action/install_origin_asset_dependencies.rb +3 -1
  14. data/lib/vagrant-openshift/action/install_origin_base_dependencies.rb +67 -6
  15. data/lib/vagrant-openshift/action/local_origin_checkout.rb +1 -1
  16. data/lib/vagrant-openshift/action/push_openshift_images.rb +2 -2
  17. data/lib/vagrant-openshift/action/run_origin_aggregated_logging_tests.rb +88 -0
  18. data/lib/vagrant-openshift/action/run_origin_tests.rb +28 -15
  19. data/lib/vagrant-openshift/action/sync_local_repository.rb +3 -2
  20. data/lib/vagrant-openshift/action/yum_update.rb +4 -0
  21. data/lib/vagrant-openshift/action.rb +59 -0
  22. data/lib/vagrant-openshift/command/build_origin_images.rb +58 -0
  23. data/lib/vagrant-openshift/command/build_origin_rpm_test.rb +50 -0
  24. data/lib/vagrant-openshift/command/checkout_repositories.rb +6 -1
  25. data/lib/vagrant-openshift/command/create_local_yum_repo.rb +56 -0
  26. data/lib/vagrant-openshift/command/download_artifacts_origin_aggregated_logging.rb +49 -0
  27. data/lib/vagrant-openshift/command/local_origin_setup.rb +5 -0
  28. data/lib/vagrant-openshift/command/repo_sync_origin_aggregated_logging.rb +71 -0
  29. data/lib/vagrant-openshift/command/test_origin.rb +14 -1
  30. data/lib/vagrant-openshift/command/test_origin_aggregated_logging.rb +67 -0
  31. data/lib/vagrant-openshift/command/test_origin_image.rb +6 -4
  32. data/lib/vagrant-openshift/constants.rb +19 -1
  33. data/lib/vagrant-openshift/plugin.rb +30 -0
  34. data/lib/vagrant-openshift/version.rb +1 -1
  35. metadata +13 -2
@@ -0,0 +1,56 @@
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
+
22
+ class CreateLocalYumRepo < Vagrant.plugin(2, :command)
23
+ include CommandHelper
24
+
25
+ def self.synopsis
26
+ "create yum repo from locally generated RPMs"
27
+ end
28
+
29
+ def execute
30
+ options = {}
31
+ options[:rpmdir_loc] = nil
32
+
33
+ opts = OptionParser.new do |o|
34
+ o.banner = "Usage: vagrant create-local-yum-repo [vm-name]"
35
+ o.separator ""
36
+
37
+ o.on("--rpmdir_loc [directory]", String, "Directory where the RPMs exist on the vm.") do |f|
38
+ options[:rpmdir_loc] = f
39
+ end
40
+
41
+ end
42
+
43
+ # Parse the options
44
+ argv = parse_options(opts)
45
+ return if !argv
46
+
47
+ with_target_vms(argv, :reverse => true) do |machine|
48
+ actions = Vagrant::Openshift::Action.create_local_yum_repo(options)
49
+ @env.action_runner.run actions, {:machine => machine}
50
+ 0
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ 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 DownloadArtifactsOriginAggregatedLogging < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "download the origin-aggregated-logging 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-aggregated-logging [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_aggregated_logging_artifacts(options)
42
+ @env.action_runner.run actions, {:machine => machine}
43
+ 0
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -29,6 +29,7 @@ module Vagrant
29
29
  options = {
30
30
  :branch => 'master',
31
31
  :replace => false,
32
+ :repo => 'origin'
32
33
  }
33
34
 
34
35
  opts = OptionParser.new do |o|
@@ -46,6 +47,10 @@ module Vagrant
46
47
  o.on("-r", "--replace", "Delete existing cloned dirs first. Default is to skip repos that are already cloned.") do |f|
47
48
  options[:replace] = f
48
49
  end
50
+
51
+ o.on("", "--repo [reponame]", "Repo to checkout. Default is 'origin'.") do |f|
52
+ options[:repo] = f
53
+ end
49
54
  end
50
55
 
51
56
  # Parse the options
@@ -0,0 +1,71 @@
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 RepoSyncOriginAggregatedLogging < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "syncs your local repos to the current instance"
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+ options[:images] = true
31
+ options[:build] = true
32
+ options[:clean] = false
33
+ options[:source] = false
34
+ options[:repo] = 'origin-aggregated-logging'
35
+
36
+ opts = OptionParser.new do |o|
37
+ o.banner = "Usage: vagrant sync-origin-aggregated-logging [vm-name]"
38
+ o.separator ""
39
+
40
+ o.on("-s", "--source", "Sync the source (not required if using synced folders)") do |f|
41
+ options[:source] = f
42
+ end
43
+
44
+ o.on("-c", "--clean", "Delete existing repo before syncing source") do |f|
45
+ options[:clean] = f
46
+ end
47
+
48
+ o.on("--dont-install", "Don't build and install updated source") do |f|
49
+ options[:build] = false
50
+ end
51
+
52
+ o.on("--no-images", "Don't build updated component Docker images") do |f|
53
+ options[:images] = false
54
+ end
55
+
56
+ end
57
+
58
+ # Parse the options
59
+ argv = parse_options(opts)
60
+ return if !argv
61
+
62
+ with_target_vms(argv, :reverse => true) do |machine|
63
+ actions = Vagrant::Openshift::Action.repo_sync_origin_aggregated_logging(options)
64
+ @env.action_runner.run actions, {:machine => machine}
65
+ 0
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -35,6 +35,14 @@ module Vagrant
35
35
  o.banner = "Usage: vagrant test-origin [machine-name]"
36
36
  o.separator ""
37
37
 
38
+ o.on("-t", "--target MAKEFILE_TARGETS", String, "Arguments to pass to the repository Makefile") do |f|
39
+ options[:target] = f
40
+ end
41
+
42
+ o.on("", "--root", String, "Run tests as root") do |f|
43
+ options[:root] = true
44
+ end
45
+
38
46
  o.on("-a", "--all", String, "Run all tests") do |f|
39
47
  options[:all] = true
40
48
  end
@@ -63,9 +71,14 @@ module Vagrant
63
71
  options[:parallel] = true
64
72
  end
65
73
 
66
- o.on("-r","--image-registry", String, "Image registry to configure tests with") do |f|
74
+ o.on("-r","--image-registry REGISTRY", String, "Image registry to configure tests with") do |f|
67
75
  options[:image_registry] = f
68
76
  end
77
+
78
+ o.on("", "--env ENV=VALUE", String, "Environment variable to execute tests with") do |f|
79
+ options[:envs] = [] unless options[:envs]
80
+ options[:envs] << f
81
+ end
69
82
  end
70
83
 
71
84
  # Parse the options
@@ -0,0 +1,67 @@
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 TestOriginAggregatedLogging < Vagrant.plugin(2, :command)
22
+ include CommandHelper
23
+
24
+ def self.synopsis
25
+ "run the origin-aggregated-logging tests"
26
+ end
27
+
28
+ def execute
29
+ options = {}
30
+ options[:download] = false
31
+
32
+ opts = OptionParser.new do |o|
33
+ o.banner = "Usage: vagrant test-origin-aggregated-logging [machine-name]"
34
+ o.separator ""
35
+
36
+ o.on("", "--root", String, "Run tests as root") do |f|
37
+ options[:root] = true
38
+ end
39
+
40
+ o.on("-d","--artifacts", String, "Download logs") do |f|
41
+ options[:download] = true
42
+ end
43
+
44
+ o.on("-r","--image-registry", String, "Image registry to configure tests with") do |f|
45
+ options[:image_registry] = f
46
+ end
47
+
48
+ o.on("", "--env ENV=VALUE", String, "Environment variable to execute tests with") do |f|
49
+ options[:envs] = [] unless options[:envs]
50
+ options[:envs] << f
51
+ end
52
+ end
53
+
54
+ # Parse the options
55
+ argv = parse_options(opts)
56
+ return if !argv
57
+
58
+ with_target_vms(argv, :reverse => true) do |machine|
59
+ actions = Vagrant::Openshift::Action.run_origin_aggregated_logging_tests(options)
60
+ @env.action_runner.run actions, {:machine => machine}
61
+ 0
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -91,7 +91,10 @@ module Vagrant
91
91
  rc=1
92
92
  begin
93
93
  out, err, rc = do_execute(machine, %{
94
- set -x
94
+ set -o errexit
95
+ set -o nounset
96
+ set -o pipefail
97
+ set -o xtrace
95
98
 
96
99
  # NOTE: This is only for rhel7
97
100
  if [ -n "#{registry}" -a -f /etc/sysconfig/docker ]; then
@@ -129,12 +132,12 @@ if [ "#{base_images}" == "true" -a -n "#{registry}" ]; then
129
132
  docker pull #{registry}/openshift/base-rhel7 && docker tag #{registry}/openshift/base-rhel7 openshift/base-rhel7
130
133
  fi
131
134
 
132
- if ! sudo env "PATH=$PATH" make test TARGET=rhel7; then
135
+ if ! sudo env "PATH=$PATH" SKIP_SQUASH=1 make test TARGET=rhel7; then
133
136
  echo "ERROR: #{image}-rhel7 failed testing."
134
137
  exit 1
135
138
  fi
136
139
 
137
- if ! sudo env "PATH=$PATH" make test TARGET=centos7; then
140
+ if ! sudo env "PATH=$PATH" SKIP_SQUASH=1 make test TARGET=centos7; then
138
141
  echo "ERROR: #{image}-centos7 failed testing."
139
142
  exit 1
140
143
  fi
@@ -142,7 +145,6 @@ fi
142
145
  # clean up
143
146
  cd /
144
147
  sudo rm -rf $temp_dir
145
- exit $status
146
148
  })
147
149
  # Vagrant throws an exception if any execute invocation returns non-zero,
148
150
  # so catch it so we can return a proper output.
@@ -23,6 +23,10 @@ module Vagrant
23
23
  openshift_repos
24
24
  end
25
25
 
26
+ def self.logging_repos(env)
27
+ aggregated_logging_repos
28
+ end
29
+
26
30
  def self.openshift_repos
27
31
  {
28
32
  'origin' => 'https://github.com/openshift/origin.git',
@@ -30,7 +34,21 @@ module Vagrant
30
34
  }
31
35
  end
32
36
 
33
- def self.git_branch_current
37
+ def self.aggregated_logging_repos
38
+ {
39
+ 'origin-aggregated-logging' => 'https://github.com/openshift/origin-aggregated-logging.git'
40
+ }
41
+ end
42
+
43
+ def self.repos_for_name(reponame)
44
+ {
45
+ 'origin' => openshift_repos,
46
+ nil => openshift_repos,
47
+ 'origin-aggregated-logging' => aggregated_logging_repos
48
+ }[reponame]
49
+ end
50
+
51
+ def self.git_branch_current
34
52
  "$(git rev-parse --abbrev-ref HEAD)"
35
53
  end
36
54
 
@@ -47,6 +47,21 @@ module Vagrant
47
47
  Commands::BuildAtomicHost
48
48
  end
49
49
 
50
+ command "build-origin-rpm-test" do
51
+ require_relative "command/build_origin_rpm_test"
52
+ Commands::BuildOriginRpmTest
53
+ end
54
+
55
+ command "build-origin-images" do
56
+ require_relative "command/build_origin_images"
57
+ Commands::BuildOriginImages
58
+ end
59
+
60
+ command "create-local-yum-repo" do
61
+ require_relative "command/create_local_yum_repo"
62
+ Commands::CreateLocalYumRepo
63
+ end
64
+
50
65
  command "build-origin-base" do
51
66
  require_relative "command/build_origin_base"
52
67
  Commands::BuildOriginBase
@@ -112,11 +127,21 @@ module Vagrant
112
127
  Commands::TestSti
113
128
  end
114
129
 
130
+ command "test-origin-aggregated-logging" do
131
+ require_relative "command/test_origin_aggregated_logging"
132
+ Commands::TestOriginAggregatedLogging
133
+ end
134
+
115
135
  command "download-artifacts-origin" do
116
136
  require_relative "command/download_artifacts_origin"
117
137
  Commands::DownloadArtifactsOrigin
118
138
  end
119
139
 
140
+ command "download-artifacts-origin-aggregated-logging" do
141
+ require_relative "command/download_artifacts_origin_aggregated_logging"
142
+ Commands::DownloadArtifactsOriginAggregatedLogging
143
+ end
144
+
120
145
  command "download-artifacts-sti" do
121
146
  require_relative "command/download_artifacts_sti"
122
147
  Commands::DownloadArtifactsSti
@@ -152,6 +177,11 @@ module Vagrant
152
177
  Commands::TestOriginImage
153
178
  end
154
179
 
180
+ command "sync-origin-aggregated-logging" do
181
+ require_relative "command/repo_sync_origin_aggregated_logging"
182
+ Commands::RepoSyncOriginAggregatedLogging
183
+ end
184
+
155
185
  provisioner(:openshift) do
156
186
  require_relative "provisioner"
157
187
  Provisioner
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Vagrant
18
18
  module Openshift
19
- VERSION = "3.0.3"
19
+ VERSION = "3.0.4"
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-openshift
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Red Hat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-20 00:00:00.000000000 Z
11
+ date: 2016-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -126,6 +126,8 @@ files:
126
126
  - lib/vagrant-openshift/action/atomic_host_upgrade.rb
127
127
  - lib/vagrant-openshift/action/build_origin.rb
128
128
  - lib/vagrant-openshift/action/build_origin_base_images.rb
129
+ - lib/vagrant-openshift/action/build_origin_images.rb
130
+ - lib/vagrant-openshift/action/build_origin_rpm_test.rb
129
131
  - lib/vagrant-openshift/action/build_sti.rb
130
132
  - lib/vagrant-openshift/action/checkout_repositories.rb
131
133
  - lib/vagrant-openshift/action/clean.rb
@@ -133,8 +135,10 @@ files:
133
135
  - lib/vagrant-openshift/action/clone_upstream_repositories.rb
134
136
  - lib/vagrant-openshift/action/create_ami.rb
135
137
  - lib/vagrant-openshift/action/create_bare_repo_placeholders.rb
138
+ - lib/vagrant-openshift/action/create_local_yum_repo.rb
136
139
  - lib/vagrant-openshift/action/create_yum_repositories.rb
137
140
  - lib/vagrant-openshift/action/download_artifacts_origin.rb
141
+ - lib/vagrant-openshift/action/download_artifacts_origin_aggregated_logging.rb
138
142
  - lib/vagrant-openshift/action/download_artifacts_sti.rb
139
143
  - lib/vagrant-openshift/action/generate_template.rb
140
144
  - lib/vagrant-openshift/action/install_origin.rb
@@ -147,6 +151,7 @@ files:
147
151
  - lib/vagrant-openshift/action/prepare_ssh_config.rb
148
152
  - lib/vagrant-openshift/action/push_openshift_images.rb
149
153
  - lib/vagrant-openshift/action/push_openshift_release.rb
154
+ - lib/vagrant-openshift/action/run_origin_aggregated_logging_tests.rb
150
155
  - lib/vagrant-openshift/action/run_origin_tests.rb
151
156
  - lib/vagrant-openshift/action/run_sti_tests.rb
152
157
  - lib/vagrant-openshift/action/run_systemctl.rb
@@ -159,11 +164,15 @@ files:
159
164
  - lib/vagrant-openshift/command/build_origin.rb
160
165
  - lib/vagrant-openshift/command/build_origin_base.rb
161
166
  - lib/vagrant-openshift/command/build_origin_base_images.rb
167
+ - lib/vagrant-openshift/command/build_origin_images.rb
168
+ - lib/vagrant-openshift/command/build_origin_rpm_test.rb
162
169
  - lib/vagrant-openshift/command/build_sti.rb
163
170
  - lib/vagrant-openshift/command/checkout_repositories.rb
164
171
  - lib/vagrant-openshift/command/clone_upstream_repositories.rb
165
172
  - lib/vagrant-openshift/command/create_ami.rb
173
+ - lib/vagrant-openshift/command/create_local_yum_repo.rb
166
174
  - lib/vagrant-openshift/command/download_artifacts_origin.rb
175
+ - lib/vagrant-openshift/command/download_artifacts_origin_aggregated_logging.rb
167
176
  - lib/vagrant-openshift/command/download_artifacts_sti.rb
168
177
  - lib/vagrant-openshift/command/install_origin.rb
169
178
  - lib/vagrant-openshift/command/install_origin_assets_base.rb
@@ -174,8 +183,10 @@ files:
174
183
  - lib/vagrant-openshift/command/push_openshift_images.rb
175
184
  - lib/vagrant-openshift/command/push_openshift_release.rb
176
185
  - lib/vagrant-openshift/command/repo_sync_origin.rb
186
+ - lib/vagrant-openshift/command/repo_sync_origin_aggregated_logging.rb
177
187
  - lib/vagrant-openshift/command/repo_sync_sti.rb
178
188
  - lib/vagrant-openshift/command/test_origin.rb
189
+ - lib/vagrant-openshift/command/test_origin_aggregated_logging.rb
179
190
  - lib/vagrant-openshift/command/test_origin_image.rb
180
191
  - lib/vagrant-openshift/command/test_sti.rb
181
192
  - lib/vagrant-openshift/command/try_restart_origin.rb