summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-03-20 07:57:43 -0700
committerGitHub <noreply@github.com>2018-03-20 07:57:43 -0700
commitf024dc6865b790fdaf168310005b425dbbdcb84b (patch)
tree4b447a518f7b5df43d0334e2bad48b71d9d2a392
parent5cd74953c899095f0d63fe3d0941a64654aba84e (diff)
parent00d33cac95db5ca34caf7dcdb105f392fa57a858 (diff)
downloadchef-f024dc6865b790fdaf168310005b425dbbdcb84b.tar.gz
Merge pull request #7004 from chef/amazon_linux_build_essential
Don't try to install old GCC packages on Amazon Linux 2
-rw-r--r--.travis.yml19
-rw-r--r--kitchen-tests/.kitchen.travis.yml9
-rw-r--r--lib/chef/resource/build_essential.rb2
3 files changed, 28 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index fd2b2b9d3b..b053cd519e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -133,11 +133,28 @@ matrix:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- cd kitchen-tests
script:
+ - bundle exec kitchen test base-amazonlinux-2
+ after_failure:
+ - cat .kitchen/logs/kitchen.log
+ env:
+ - AMAZON=2
+ - KITCHEN_YAML=.kitchen.travis.yml
+ - rvm: 2.4.3
+ services: docker
+ sudo: required
+ gemfile: kitchen-tests/Gemfile
+ before_install:
+ - gem update --system $(grep rubygems omnibus_overrides.rb | cut -d'"' -f2)
+ - gem install bundler -v $(grep :bundler omnibus_overrides.rb | cut -d'"' -f2)
+ before_script:
+ - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
+ - cd kitchen-tests
+ script:
- bundle exec kitchen test base-amazonlinux
after_failure:
- cat .kitchen/logs/kitchen.log
env:
- - AMAZON=LATEST
+ - AMAZON=201X
- KITCHEN_YAML=.kitchen.travis.yml
- rvm: 2.4.3
services: docker
diff --git a/kitchen-tests/.kitchen.travis.yml b/kitchen-tests/.kitchen.travis.yml
index 54a4ec6bc2..fdf4f05f69 100644
--- a/kitchen-tests/.kitchen.travis.yml
+++ b/kitchen-tests/.kitchen.travis.yml
@@ -37,6 +37,15 @@ platforms:
- RUN yum -y install sudo
- RUN sed -i -e "s/Defaults.*requiretty.*/Defaults !requiretty/g" /etc/sudoers
+- name: amazonlinux-2
+ driver:
+ image: dokken/amazonlinux-2
+ pid_one_command: /usr/lib/systemd/systemd
+ intermediate_instructions:
+ - RUN yum -y install sudo
+ - RUN sed -i -e "s/Defaults.*requiretty.*/Defaults !requiretty/g" /etc/sudoers
+
+
- name: debian-8
driver:
image: dokken/debian-8
diff --git a/lib/chef/resource/build_essential.rb b/lib/chef/resource/build_essential.rb
index 7998006398..fb9ef814a5 100644
--- a/lib/chef/resource/build_essential.rb
+++ b/lib/chef/resource/build_essential.rb
@@ -40,7 +40,7 @@ class Chef
declare_resource(:package, %w{ autoconf bison flex gcc gcc-c++ gettext kernel-devel make m4 ncurses-devel patch })
# Ensure GCC 4 is available on older pre-6 EL
- declare_resource(:package, %w{ gcc44 gcc44-c++ }) if node["platform_version"].to_i < 6
+ declare_resource(:package, %w{ gcc44 gcc44-c++ }) if platform_family?("rhel") && node["platform_version"].to_i < 6
when "freebsd"
declare_resource(:package, "devel/gmake")
declare_resource(:package, "devel/autoconf")