vagrant-openshift 3.0.0 → 3.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7160eb541de9e048c441e7db339f549436354ae3
4
- data.tar.gz: bef0f3dbed4812c82833bdafdd6977347b388a03
3
+ metadata.gz: fb0f56f5dc6e4e37cf5d0a1451d70b2965876e8f
4
+ data.tar.gz: 1d929e4d3925012e8c74db28229a2a04c024d0f8
5
5
  SHA512:
6
- metadata.gz: 8bb8f17e5aa85c520fa182855de18d98e2e375443e2856e8f650f23157e6ce155e5450845b101980b2b88f61ce03a9838e871b5e9106189074b25b68b8521853
7
- data.tar.gz: 1b213155c7db4fd465b392b8daddcfd52f6efb43b23f3c8bd6a87528ee4069265eea30b122fa2a4165edc04639ebfba3706dfadbff3168d73dbf09ef13d7e91f
6
+ metadata.gz: eac2e56b2c0ffb2d6e06336da506f72c475b4bce330811a0144071a738b3fd198bac55f8c83fbf9cccb42614cb71f7e9a79fb17c267f4716df7a69fa80cdc039
7
+ data.tar.gz: 1774e76335dce92535c1d578c9305b8a4b8c8b1e4587df0bc391439a643a616889297834c882a1d8068dc617a4eecfd104392f6e1f9085efd415eaab9d2faa7f
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ rvm:
2
+ - 2.0.0
3
+ - 2.1.7
4
+ - 2.2.3
5
+
6
+ gemfile: Gemfile
7
+
8
+ sudo: false
data/README.asciidoc CHANGED
@@ -1,5 +1,7 @@
1
1
  == OpenShift Origin Build Tools
2
2
 
3
+ image:https://travis-ci.org/openshift/vagrant-openshift.svg?branch=master[link=https://travis-ci.org/openshift/vagrant-openshift]
4
+
3
5
  This is a link:http://www.vagrantup.com[Vagrant] 1.7.2+ plugin that adds vagrant commands and provisioners to
4
6
  build and test link:http://openshift.github.io[OpenShift Origin].
5
7
 
data/Rakefile CHANGED
@@ -24,18 +24,31 @@ namespace :vagrant do
24
24
 
25
25
  desc "Install plugin into Vagrant"
26
26
  task :install do
27
+
28
+ syntax_check_cmd = %{
29
+ set -e
30
+ for f in `find lib -name *.rb`
31
+ do
32
+ ruby -c $f >/dev/null;
33
+ done
34
+ }
35
+ `#{syntax_check_cmd}`
36
+ if $?.exitstatus != 0
37
+ exit 1
38
+ end
39
+
27
40
  # We want to install our plugin on the system vagrant. Pull gem paths out of
28
41
  # $PATH so that we get the correct vagrant binary.
29
42
  dirty_path = `echo $PATH`
30
43
  clean_path = dirty_path.split(':').select{ |p| not p.include?('gem') }.join(':')
31
44
  sys_cmd = `PATH=#{clean_path} which vagrant`.chomp
32
- if not $?.exitstatus == 0
45
+ if $?.exitstatus != 0
33
46
  sys_cmd = `which vagrant`.chomp
34
47
  if not $?.exitstatus == 0
35
- puts "ERROR: Could not find a Vagrant binary in your PATH.\nEnsure that Vagrant has been installed on this system."
36
- exit
48
+ $stderr.puts "ERROR: Could not find a Vagrant binary in your PATH.\nEnsure that Vagrant has been installed on this system."
49
+ exit 1
37
50
  else
38
- puts "WARNING: Could not find a Vagrant binary outside of your gem environments.\nEnsure that the Vagrant package has been installed from the official Vagrant packages and not a gem."
51
+ $stderr.puts "WARNING: Could not find a Vagrant binary outside of your gem environments.\nEnsure that the Vagrant package has been installed from the official Vagrant packages and not a gem."
39
52
  end
40
53
  end
41
54
 
@@ -45,7 +58,10 @@ namespace :vagrant do
45
58
  name = Bundler::GemHelper.instance.send(:name)
46
59
  version = Bundler::GemHelper.instance.send(:version).to_s
47
60
 
48
- system "#{sys_cmd} plugin uninstall vagrant-openshift; #{sys_cmd} plugin install pkg/#{name}-#{version}.gem"
61
+ install_cmd = %{
62
+ #{sys_cmd} plugin install pkg/#{name}-#{version}.gem
63
+ }
64
+ system(install_cmd)
49
65
  end
50
66
  end
51
67
 
@@ -31,4 +31,4 @@ module Vagrant
31
31
  end
32
32
  end
33
33
 
34
- require "vagrant-openshift/plugin"
34
+ require "vagrant-openshift/plugin"
@@ -27,7 +27,7 @@ module Vagrant
27
27
  def call(env)
28
28
  ssh_user = env[:machine].ssh_info[:username]
29
29
  sudo(env[:machine], %{
30
- set -x
30
+ set -ex
31
31
 
32
32
  #systemctl enable firewalld
33
33
  #systemctl start firewalld
@@ -40,7 +40,7 @@ set -x
40
40
  ORIGIN_PATH=/data/src/github.com/openshift/origin
41
41
  cat > /etc/profile.d/openshift.sh <<DELIM
42
42
  export GOPATH=/data
43
- export PATH=$ORIGIN_PATH/_output/etcd/bin:$ORIGIN_PATH/_output/local/go/bin/:$GOPATH/bin:$PATH
43
+ export PATH=$ORIGIN_PATH/_output/etcd/bin:$ORIGIN_PATH/_output/local/bin/linux/amd64:$GOPATH/bin:$PATH
44
44
  export KUBECONFIG=/openshift.local.config/master/admin.kubeconfig
45
45
  DELIM
46
46
 
@@ -99,7 +99,7 @@ chmod +x /usr/bin/generate_openshift_service
99
99
  #systemctl enable openshift.service
100
100
 
101
101
  chown -R #{ssh_user}:#{ssh_user} /data
102
- })
102
+ }, :verbose => false)
103
103
 
104
104
  @app.call(env)
105
105
  end
@@ -27,8 +27,8 @@ module Vagrant
27
27
  end
28
28
 
29
29
  def call(env)
30
- ssh_user = env[:machine].ssh_info[:username]
31
30
  cmd = %{
31
+ set -ex
32
32
 
33
33
  ORIGIN_PATH=/data/src/github.com/openshift/origin
34
34
  ASSET_BACKUP_DIR=/data/asset_dependencies
@@ -65,7 +65,7 @@ popd
65
65
  }
66
66
  end
67
67
 
68
- do_execute(env[:machine], cmd, {:timeout=>60*20})
68
+ do_execute(env[:machine], cmd, :verbose => false, :timeout=>60*20)
69
69
  @app.call(env)
70
70
  end
71
71
  end
@@ -35,15 +35,16 @@ if ! [[ -L /etc/udev/rules.d/80-net-setup-link.rules ]]; then
35
35
  ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
36
36
  rm -f /etc/sysconfig/network-scripts/ifcfg-enp0s3
37
37
  fi
38
- })
38
+ }, :verbose => false)
39
39
  end
40
40
 
41
41
  ssh_user = env[:machine].ssh_info[:username]
42
- sudo(env[:machine], "yum install -y git fontconfig yum-utils wget make mlocate bind augeas vim docker-io hg bzr libselinux-devel vim tig glibc-static btrfs-progs-devel device-mapper-devel sqlite-devel libnetfilter_queue-devel gcc gcc-c++ e2fsprogs tmux tmux httpie ctags hg xfsprogs rubygems openvswitch bridge-utils bzip2 ntp screen java-1.?.0-openjdk bind-utils socat unzip Xvfb ethtool openldap-clients jq", {:timeout=>60*20})
43
- sudo(env[:machine], "yum install -y facter", {fail_on_error: false, :timeout=>60*10})
42
+ sudo(env[:machine], "yum install -y git fontconfig yum-utils wget make mlocate bind augeas vim docker-io hg bzr libselinux-devel vim tig glibc-static btrfs-progs-devel device-mapper-devel sqlite-devel libnetfilter_queue-devel gcc gcc-c++ e2fsprogs tmux tmux httpie ctags hg xfsprogs rubygems openvswitch bridge-utils bzip2 ntp screen java-1.?.0-openjdk bind-utils socat unzip Xvfb ethtool openldap-clients jq", :timeout=>60*20, :verbose => false)
43
+ sudo(env[:machine], "yum install -y facter", fail_on_error: false, :timeout=>60*10, :verbose => false)
44
44
 
45
45
  # Install Chrome and chromedriver for headless UI testing
46
46
  sudo(env[:machine], %{
47
+ set -ex
47
48
  cd /tmp
48
49
 
49
50
  # Add signing key for Chrome repo
@@ -62,20 +63,21 @@ unzip chromedriver_linux64.zip
62
63
  mv chromedriver /usr/bin/chromedriver
63
64
  chown root /usr/bin/chromedriver
64
65
  chmod 755 /usr/bin/chromedriver
65
- }, {:timeout=>60*10})
66
+ }, :timeout=>60*10, :verbose => false)
66
67
 
67
68
  #
68
69
  # FIXME: Need to install golang packages 'after' the 'gcc' is
69
70
  # installed. See BZ#1101508
70
71
  #
71
- sudo(env[:machine], "yum install -y golang golang-pkg-linux-amd64 golang-src", {:timeout=>60*10})
72
+ sudo(env[:machine], "yum install -y golang golang-pkg-linux-amd64 golang-src", :timeout=>60*10, :verbose => false)
72
73
  #
73
74
  sudo(env[:machine], %{
74
-
75
75
  set -ex
76
- # TODO Remove me ASAP
77
- sed -i 's,^SELINUX=.*,SELINUX=permissive,' /etc/selinux/config
78
- setenforce 0
76
+ if ! test -e /etc/fedora-release; then
77
+ # TODO Remove me ASAP
78
+ sed -i 's,^SELINUX=.*,SELINUX=permissive,' /etc/selinux/config
79
+ setenforce 0
80
+ fi
79
81
 
80
82
  systemctl enable ntpd
81
83
 
@@ -84,7 +86,6 @@ usermod -a -G docker #{ssh_user}
84
86
 
85
87
  sed -i "s,^OPTIONS='\\(.*\\)',OPTIONS='--insecure-registry=172.30.0.0/16 \\1'," /etc/sysconfig/docker
86
88
  sed -i "s,^OPTIONS=-\\(.*\\),OPTIONS='--insecure-registry=172.30.0.0/16 -\\1'," /etc/sysconfig/docker
87
-
88
89
  sed -i "s,^ADD_REGISTRY='\\(.*\\)',#ADD_REGISTRY='--add-registry=docker.io \\1'," /etc/sysconfig/docker
89
90
 
90
91
  cat /etc/sysconfig/docker
@@ -127,7 +128,7 @@ systemctl daemon-reexec
127
128
  systemctl daemon-reload
128
129
  systemctl enable docker
129
130
  time systemctl start docker
130
- }, {:timeout=>60*30})
131
+ }, :timeout=>60*30, :verbose => false)
131
132
  @app.call(env)
132
133
  end
133
134
  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*2, :fail_on_error => false, :verbose => false})
51
+ _,_,exit_code = sudo(env[:machine], cmd, {:timeout => 60*60*4, :fail_on_error => false, :verbose => false})
52
52
  else
53
- _,_,exit_code = do_execute(env[:machine], cmd, {:timeout => 60*60*2, :fail_on_error => false, :verbose => false})
53
+ _,_,exit_code = do_execute(env[:machine], cmd, {:timeout => 60*60*4, :fail_on_error => false, :verbose => false})
54
54
  end
55
55
  exit_code
56
56
  end
@@ -98,9 +98,8 @@ popd >/dev/null
98
98
  env[:test_exit_code] = run_tests(env, [cmd], false)
99
99
 
100
100
  if env[:test_exit_code] == 0 && @options[:extended_test_packages].length > 0
101
- # for extended tests we need a ginkgo binary
102
- do_execute(env[:machine], "go get github.com/onsi/ginkgo/ginkgo", {:timeout => 60*60*2, :fail_on_error => true, :verbose => false})
103
101
  cmds = parse_extended(@options[:extended_test_packages])
102
+ cmds = cmds.map{ |s| 'TEST_REPORT_DIR=/tmp/openshift-extended-tests/junit/extended ' + s }
104
103
  env[:test_exit_code] = run_tests(env, cmds, true)
105
104
  end
106
105
 
@@ -33,7 +33,7 @@ module Vagrant
33
33
  remote_write(env[:machine], "/etc/hostname") {
34
34
  hostname
35
35
  }
36
- sudo(env[:machine],"restorecon -v /etc/sysconfig/network /etc/hostname")
36
+ sudo(env[:machine],"restorecon -v /etc/sysconfig/network /etc/hostname", :verbose => false)
37
37
 
38
38
  @app.call(env)
39
39
  end
@@ -21,13 +21,34 @@ module Vagrant
21
21
  module CommandHelper
22
22
 
23
23
  def sudo(machine, command, options={})
24
+ options[:sudo] = true
25
+ do_execute(machine, command, options)
26
+ end
27
+
28
+ def do_execute(machine, command, options={})
24
29
  stdout = []
25
30
  stderr = []
26
31
  rc = -1
27
- options[:timeout] = 60*10 unless options.has_key? :timeout
28
- options[:verbose] = true unless options.has_key? :verbose
29
- options[:retries] = 0 unless options.has_key? :retries
30
- options[:fail_on_error] = true unless options.has_key? :fail_on_error
32
+
33
+ options = {
34
+ timeout: 60*60*4,
35
+ verbose: true,
36
+ retries: 0,
37
+ fail_on_error: true
38
+ }.merge(options || {})
39
+
40
+ execute = lambda { |type, data|
41
+ if [:stderr, :stdout].include?(type)
42
+ if type == :stdout
43
+ color = :green
44
+ stdout << data
45
+ else
46
+ color = :red
47
+ stderr << data
48
+ end
49
+ machine.env.ui.info(data, :color => color, :new_line => false, :prefix => false) unless options[:buffered_output] == true
50
+ end
51
+ }
31
52
 
32
53
  (0..options[:retries]).each do |retry_count|
33
54
  begin
@@ -37,17 +58,10 @@ module Vagrant
37
58
  machine.env.ui.info "Retrying. Attempt ##{retry_count} with timeout #{options[:timeout]}"
38
59
  end
39
60
  Timeout::timeout(options[:timeout]) do
40
- rc = machine.communicate.sudo(command) do |type, data|
41
- if [:stderr, :stdout].include?(type)
42
- if type == :stdout
43
- color = :green
44
- stdout << data
45
- else
46
- color = :red
47
- stderr << data
48
- end
49
- machine.env.ui.info(data, :color => color, :new_line => false, :prefix => false) unless options[:buffered_output] == true
50
- end
61
+ if options[:sudo]
62
+ rc = machine.communicate.sudo(command, nil, &execute)
63
+ else
64
+ rc = machine.communicate.execute(command, nil, &execute)
51
65
  end
52
66
  end
53
67
  rescue Timeout::Error
@@ -58,34 +72,9 @@ module Vagrant
58
72
  machine.env.ui.warn e.message
59
73
  rc ||= -1
60
74
  end
61
-
62
75
  break if rc == 0
63
76
  end
64
77
  exit rc if options[:fail_on_error] && rc != 0
65
-
66
- [stdout, stderr, rc]
67
- end
68
-
69
- def do_execute(machine, command, options={})
70
- stdout = []
71
- stderr = []
72
- rc = -1
73
- options[:verbose] = true unless options.has_key? :verbose
74
-
75
- machine.env.ui.info "Running command '#{command}'" if options[:verbose]
76
- rc = machine.communicate.execute(command) do |type, data|
77
- if [:stderr, :stdout].include?(type)
78
- if type == :stdout
79
- color = :green
80
- stdout << data
81
- else
82
- color = :red
83
- stderr << data
84
- end
85
- machine.env.ui.info(data, :color => color, :new_line => false, :prefix => false)
86
- end
87
- end
88
-
89
78
  [stdout, stderr, rc]
90
79
  end
91
80
 
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Vagrant
18
18
  module Openshift
19
- VERSION = "3.0.0"
19
+ VERSION = "3.0.1"
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.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Red Hat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-20 00:00:00.000000000 Z
11
+ date: 2015-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -116,6 +116,7 @@ extra_rdoc_files: []
116
116
  files:
117
117
  - ".gitattributes"
118
118
  - ".gitignore"
119
+ - ".travis.yml"
119
120
  - Gemfile
120
121
  - LICENSE.txt
121
122
  - README.asciidoc