Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Docker acceptance on travis #58

Merged
merged 3 commits into from
Apr 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
modules/
modulesync.yml
/modules/
/modulesync.yml
/.bundle/
/Gemfile.lock
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ config_defaults.yml might look like:
You can add additional environments for a specific module to test by adding an
extras: section with the same format to the module's .sync.yml.

By setting the `docker_sets`, the .travis.yml file sets up full-system tests running in a docker container. `docker_defaults` allows you to specify or replace global defaults. Use the `options` entry on a docker set, to override individual options.

**`moduleroot/.rspec`**

Flat file containing recommended default rspec options.
Expand Down
15 changes: 15 additions & 0 deletions config_defaults.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
---
.travis.yml:
script: "\"bundle exec rake validate lint spec\""
docker_sets:
- set: docker/ubuntu-14.04
- set: docker/centos-7
docker_defaults:
# values will replace @@SET@@ with the docker_sets' value
rvm: 2.1.6
sudo: required
dist: trusty
services: docker
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=@@SET@@
script: bundle exec rake beaker
includes:
- rvm: 2.1.6
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes"
bundler_args: --without system_tests
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
bundler_args: --without system_tests
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0"
bundler_args: --without system_tests
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
bundler_args: --without system_tests
Gemfile:
required:
':development, :unit_tests':
Expand Down
38 changes: 28 additions & 10 deletions moduleroot/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,44 @@
sudo: false
language: ruby
cache: bundler
bundler_args: --without system_tests
script: <%= @configs['script'] %>
matrix:
fast_finish: true
include:
<% @configs['includes'].each do |include| -%>
- rvm: <%= include['rvm'] %>
env: <%= include['env'] %>
<% if @configs['docker_sets'] -%>
<% @configs['docker_sets'].each do |set| -%>
<% job = @configs['docker_defaults'].merge(set['options'] || {}) -%>
- rvm: <%= job['rvm'] %>
<% job.keys.sort.each do |k| -%>
<% next if k == 'rvm' -%>
<%= k %>: <%= job[k].gsub(/@@SET@@/, set['set']) %>
<% end -%>
<% end -%>
<% end -%>
<% @configs['includes'].each do |job| -%>
- rvm: <%= job['rvm'] %>
<% job.keys.sort.each do |k| -%>
<% next if k == 'rvm' -%>
<%= k %>: <%= job[k] %>
<% end -%>
<% end -%>
<% if @configs['extras'] -%>
<% @configs['extras'].each do |extra| -%>
- rvm: <%= extra['rvm'] %>
env: <%= extra['env'] %>
<% @configs['extras'].each do |job| -%>
- rvm: <%= job['rvm'] %>
<% job.keys.sort.each do |k| -%>
<% next if k == 'rvm' -%>
<%= k %>: <%= job[k] %>
<% end -%>
<% end -%>
<% end -%>
<% if @configs['allow_failures'] -%>
<% @configs['allow_failures'].each do |allow_failures| -%>
allow_failures:
- rvm: <%= allow_failures['rvm'] %>
env: <%= allow_failures['env'] %>
<% @configs['allow_failures'].each do |job| -%>
- rvm: <%= job['rvm'] %>
<% job.keys.sort.each do |k| -%>
<% next if k == 'rvm' -%>
<%= k %>: <%= job[k] %>
<% end -%>
<% end -%>
<% end -%>
notifications:
Expand Down
10 changes: 0 additions & 10 deletions moduleroot/spec/acceptance/nodesets/centos-59-x64.yml

This file was deleted.

12 changes: 0 additions & 12 deletions moduleroot/spec/acceptance/nodesets/centos-64-x64-pe.yml

This file was deleted.

10 changes: 0 additions & 10 deletions moduleroot/spec/acceptance/nodesets/centos-65-x64.yml

This file was deleted.

10 changes: 10 additions & 0 deletions moduleroot/spec/acceptance/nodesets/centos-7-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HOSTS:
centos-7-x64:
roles:
- agent
- default
platform: redhat-7-x86_64
hypervisor: vagrant
box: puppetlabs/centos-7.2-64-nocm
CONFIG:
type: foss
10 changes: 10 additions & 0 deletions moduleroot/spec/acceptance/nodesets/debian-8-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HOSTS:
debian-8-x64:
roles:
- agent
- default
platform: debian-8-amd64
hypervisor: vagrant
box: puppetlabs/debian-8.2-64-nocm
CONFIG:
type: foss
10 changes: 10 additions & 0 deletions moduleroot/spec/acceptance/nodesets/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HOSTS:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not even have a default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why make people do work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

ubuntu-1404-x64:
roles:
- agent
- default
platform: ubuntu-14.04-amd64
hypervisor: vagrant
box: puppetlabs/ubuntu-14.04-64-nocm
CONFIG:
type: foss
12 changes: 12 additions & 0 deletions moduleroot/spec/acceptance/nodesets/docker/centos-7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
HOSTS:
centos-7-x64:
platform: el-7-x86_64
hypervisor: docker
image: centos:7
docker_preserve_image: true
docker_cmd: '["/usr/sbin/init"]'
# install various tools required to get the image up to usable levels
docker_image_commands:
- 'yum install -y crontabs tar wget openssl sysvinit-tools iproute which initscripts'
CONFIG:
trace_limit: 200
11 changes: 11 additions & 0 deletions moduleroot/spec/acceptance/nodesets/docker/debian-8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
HOSTS:
debian-8-x64:
platform: debian-8-amd64
hypervisor: docker
image: debian:8
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'apt-get update && apt-get install -y net-tools wget locales strace lsof && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen'
CONFIG:
trace_limit: 200
12 changes: 12 additions & 0 deletions moduleroot/spec/acceptance/nodesets/docker/ubuntu-14.04.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
HOSTS:
ubuntu-1404-x64:
platform: ubuntu-14.04-amd64
hypervisor: docker
image: ubuntu:14.04
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
# ensure that upstart is booting correctly in the container
- 'rm /usr/sbin/policy-rc.d && rm /sbin/initctl && dpkg-divert --rename --remove /sbin/initctl && apt-get update && apt-get install -y net-tools wget && locale-gen en_US.UTF-8'
CONFIG:
trace_limit: 200
10 changes: 0 additions & 10 deletions moduleroot/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml

This file was deleted.

10 changes: 0 additions & 10 deletions moduleroot/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml

This file was deleted.

11 changes: 0 additions & 11 deletions moduleroot/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml

This file was deleted.