Skip to content

Commit

Permalink
(SIMP-4989) Fix EL7 rpm_docker builds (#529)
Browse files Browse the repository at this point in the history
* Moved the installation of openssl_devel up in the stack so that it did
  not attempt to update incorrectly.
* Split out the EL tests since we had to run the separately anyway and
  made the nodesets Travis aware.
* Removed the no longer necessary travis_ci.yml
* Updated the rhel nodesets to fail if the registry is not hooked up
  correctly
* Fixed docker cp
* Removed non-functional rhel nodesets
* Removed deps checkout to try and clear cache
* Changed to more reliable keyserver
  • Loading branch information
trevor-vaughan authored and lnemsick-simp committed Jul 18, 2018
1 parent 547cf49 commit 8a189b2
Show file tree
Hide file tree
Showing 9 changed files with 210 additions and 499 deletions.
16 changes: 12 additions & 4 deletions .travis.yml
Expand Up @@ -75,13 +75,21 @@ jobs:
services:
- docker
script:
- bundle exec rake deps:checkout
- travis_wait 30 unbuffer bundle exec rake beaker:suites[rpm_docker,travis_ci]
env: PUPPET_VERSION"~> 4.8.2"
- travis_wait 30 unbuffer bundle exec rake beaker:suites[rpm_docker,el6]
env: PUPPET_VERSION"~> 4.10"

- stage: package
sudo: required
rvm: 2.1.9
services:
- docker
script:
- travis_wait 30 unbuffer bundle exec rake beaker:suites[rpm_docker,el7]
env: PUPPET_VERSION"~> 4.10"

- stage: deploy
rvm: 2.1.9
env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 4.8.2"
env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 4.10"
script:
- bundle exec rake spec
before_deploy:
Expand Down
5 changes: 3 additions & 2 deletions Puppetfile.tracking
@@ -1,11 +1,10 @@
# refs recorded for SIMP release 6.0.0
# vi:syntax=ruby

moduledir 'src'

mod 'simp-doc',
:git => 'https://github.com/simp/simp-doc',
:tag => '6.1.0-0'
:tag => 'master'

moduledir 'src/assets'

Expand Down Expand Up @@ -513,3 +512,5 @@ mod 'voxpupuli-yum',
mod 'vshn-gitlab',
:git => 'https://github.com/simp/puppet-gitlab.git',
:tag => 'v1.13.3'

# vi:syntax=ruby
4 changes: 2 additions & 2 deletions build/Dockerfiles/SIMP7_Build.dockerfile
Expand Up @@ -38,8 +38,8 @@ RUN rm -rf /etc/security/limits.d/*.conf
RUN yum-config-manager --enable extras
RUN yum install -y epel-release
RUN yum install -y openssl util-linux rpm-build augeas-devel createrepo genisoimage git gnupg2 libicu-devel libxml2 libxml2-devel libxslt libxslt-devel rpmdevtools which ruby-devel rpm-devel rpm-sign
RUN yum -y install centos-release-scl python-pip python-virtualenv fontconfig dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-serif-fonts dejavu-fonts-common libjpeg-devel zlib-devel
RUN yum install -y libyaml-devel glibc-headers autoconf gcc gcc-c++ glibc-devel readline-devel libffi-devel openssl-devel automake libtool bison sqlite-devel
RUN yum -y install centos-release-scl python-pip python-virtualenv fontconfig dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-serif-fonts dejavu-fonts-common libjpeg-devel zlib-devel openssl-devel
RUN yum install -y libyaml-devel glibc-headers autoconf gcc gcc-c++ glibc-devel readline-devel libffi-devel automake libtool bison sqlite-devel
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
RUN yum --enablerepo=base -y install python27
RUN ln -sf /bin/true /usr/bin/systemctl
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/suites/rpm_docker/00_rpm_build_spec.rb
Expand Up @@ -56,7 +56,7 @@ def get_test_env
# This needs to happen *prior* to the test selection since the test
# selection depends on this being present
if ENV['BEAKER_copyin'] == 'yes'
%x(docker cp #{Dir.pwd} #{host.name}:#{build_dir})
%x(docker cp #{Dir.pwd} #{host.host_hash[:docker_container].id}:#{build_dir})
end

it 'should clone the repo if necessary' do
Expand All @@ -69,7 +69,7 @@ def get_test_env
if ENV['TRAVIS_BUILD_DIR']
base_dir = File.dirname(ENV['TRAVIS_BUILD_DIR'])

%x(docker cp #{ENV['TRAVIS_BUILD_DIR']} #{host.name}:#{build_dir})
%x(docker cp #{ENV['TRAVIS_BUILD_DIR']} #{host.host_hash[:docker_container].id}:#{build_dir})

host.mkdir_p(base_dir)
on(host, %(cd #{base_dir}; ln -s #{build_dir} .))
Expand Down
176 changes: 0 additions & 176 deletions spec/acceptance/suites/rpm_docker/nodesets/default.yml

This file was deleted.

1 change: 1 addition & 0 deletions spec/acceptance/suites/rpm_docker/nodesets/default.yml
93 changes: 93 additions & 0 deletions spec/acceptance/suites/rpm_docker/nodesets/el6.yml
@@ -0,0 +1,93 @@
---
HOSTS:
el6-build-server:
roles:
- primary
platform: el-6-x86_64
hypervisor: docker
# This needs to be the *oldest* image of EL6 to preserve SELinux build compatibility
image: centos:6.6
docker_preserve_image: true
docker_image_commands:
# The following 2 commands are intended to solve the problem in
# https://github.com/CentOS/sig-cloud-instance-images/issues/15.
# However, sometimes these commands cause yum problems, instead
# of fixing yum problems. If the install of yum-plugin-ovl and
# yum-utils fails, try commenting out these commands.
- 'rm -f /var/lib/rpm/__db*'
- 'yum clean all'
# This is a hack to force an exit code of 0
# Sometimes yum-plugin-ovl will install dependencies, which will fail with rpmdb errors
# since yum-plugin-ovl is not installed (chicken and egg)
- 'yum install -y yum-plugin-ovl || :'
- 'yum install -y yum-utils'

# We only want to deal with the original distro packages
- 'yum-config-manager --disable \*'
- 'echo -e "[legacy]\nname=Legacy\nbaseurl=http://vault.centos.org/6.6/os/x86_64\ngpgkey=https://www.centos.org/keys/RPM-GPG-KEY-CentOS-6\ngpgcheck=1" > /etc/yum.repos.d/legacy.repo'

# Downgrade ALL THE THINGS!!!
# ...except yum and python-urlgrabber, which yum-plugin-ovl has dependencies on
- 'cd /root; yum -x yum -x python-urlgrabber downgrade -y *'

# Work around bug https://bugzilla.redhat.com/show_bug.cgi?id=1217477
# This does *not* update the SELinux packages, so it is safe
- 'yum --enablerepo=updates --enablerepo=base update -y git curl nss'

# Getting rid of package conflicts
- '\cp -a /etc/ssh /root'
- 'yum install -y openssh-server'
- '\cp -a /root/ssh /etc'

# Add the SELinux Build dependencies
- 'yum install -y selinux-policy-targeted selinux-policy-devel policycoreutils policycoreutils-python'

# Allow the build user to perform privileged operations
- "echo 'Defaults:build_user !requiretty' >> /etc/sudoers"
- "echo 'build_user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"

# Add the build user
- 'useradd -b /home -G wheel -m -c "Build User" -s /bin/bash -U build_user'

# No limits
- 'rm -rf /etc/security/limits.d/*.conf'

# simp build-deps
- 'yum-config-manager --enable extras'
- 'yum install -y epel-release'
- 'yum install -y openssl util-linux rpm-build augeas-devel createrepo genisoimage git gnupg2 libicu-devel libxml2 libxml2-devel libxslt libxslt-devel rpmdevtools which ruby-devel rpm-sign acl'

# RVM build-deps
- 'yum install -y libyaml-devel glibc-headers autoconf gcc gcc-c++ glibc-devel readline-devel libffi-devel openssl-devel automake libtool bison sqlite-devel tar'

# Puppet Deps
- 'yum install -y ntpdate rubygems'

# simp doc deps
# These need to come last due to some strangeness that can occur with SCL
- 'yum -y install centos-release-scl python-pip python-virtualenv fontconfig dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-serif-fonts dejavu-fonts-common libjpeg-devel zlib-devel'
- 'yum-config-manager --enable rhel-server-rhscl-6-rpms'
- 'yum -y install python27'

# RVM
- 'runuser build_user -l -c "gpg2 --keyserver hkp://pgp.mit.edu --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3"'
- 'runuser build_user -l -c "curl -sSL https://get.rvm.io | bash -s stable"'
- 'runuser build_user -l -c "rvm install 2.1.9 --disable-binary"'
- 'runuser build_user -l -c "rvm use --default 2.1.9"'
- 'runuser build_user -l -c "rvm all do gem install bundler --no-ri --no-rdoc"'

# Add some gems that will drag along 90% of what the build requires
- 'runuser build_user -l -c "rvm use default; gem install --no-ri --no-rdoc simp-rake-helpers"'
- 'runuser build_user -l -c "rvm use default; gem install --no-ri --no-rdoc json"'
- 'runuser build_user -l -c "rvm use default; gem install --no-ri --no-rdoc charlock_holmes"'
- 'runuser build_user -l -c "rvm use default; gem install --no-ri --no-rdoc posix-spawn"'

CONFIG:
log_level: verbose
type: aio
<% unless ENV['TRAVIS'] -%>
mount_folders:
simp_core:
host_path: './'
container_path: '/simp-core'
<% end -%>

0 comments on commit 8a189b2

Please sign in to comment.