Skip to content
Permalink
Browse files

Updated Travis CI file.

  • Loading branch information...
Frzk committed Mar 18, 2019
1 parent f5fa662 commit ecd1367d9b0b605ec4b33c79d42aea3f36f16317
Showing with 19 additions and 63 deletions.
  1. +17 −45 .travis.yml
  2. +0 −16 molecule/default/INSTALL.rst
  3. +1 −1 molecule/default/molecule.yml
  4. +1 −1 molecule/default/playbook.yml
@@ -1,56 +1,28 @@
---
sudo: required
language: bash
language: python
services:
- docker

# Build matrix
env:
- distribution: centos
version: 7
- distribution: debian
version: 9
- distribution: ubuntu
version: 16.04
- distribution: ubuntu
version: 18.04

before_install:
# Pull the image corresponding to the environment vars from Docker Hub:
- docker pull "kblr/${distribution}${version}-ansible:latest"
global:
- ROLENAME=chrony
matrix:
- DISTRIBUTION=centos7
- DISTRIBUTION=debian9
- DISTRIBUTION=ubuntu16.04
- DISTRIBUTION=ubuntu18.04

install:
- pip install molecule docker

before_script:
- cd ..
- mv ansible-role-$ROLENAME frzk.$ROLENAME
- cd frzk.$ROLENAME

script:
# 0/ Run the container:
- >
docker run
--name "${TRAVIS_COMMIT}.${distribution}-${version}"
--detach
--privileged
--mount type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup,readonly
--mount type=bind,source="$(pwd)",target=/etc/ansible/roles/under_test,readonly
"kblr/${distribution}${version}-ansible:latest"
# 1/ Check role syntax:
- >
docker exec "${TRAVIS_COMMIT}.${distribution}-${version}"
ansible-playbook -v /etc/ansible/roles/under_test/tests/test.yml --syntax-check
# 2/ Check first run:
- >
docker exec "${TRAVIS_COMMIT}.${distribution}-${version}"
ansible-playbook -v /etc/ansible/roles/under_test/tests/test.yml
# 3/ Check idempotence:
- >
docker exec "${TRAVIS_COMMIT}.${distribution}-${version}"
ansible-playbook -v /etc/ansible/roles/under_test/tests/test.yml
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
after_script:
# Remove container:
- docker rm -f "${TRAVIS_COMMIT}.${distribution}-${version}"
- molecule test

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

This file was deleted.

Oops, something went wrong.
@@ -9,7 +9,7 @@ lint:
config-file: molecule/default/yamllint.yml
platforms:
- name: instance
image: "frzk/${MOLECULE_DISTRO:-centos7}-ansible"
image: "frzk/docker-${DISTRIBUTION:-centos7}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
@@ -2,4 +2,4 @@
- name: Converge
hosts: all
roles:
- role: ansible-role-chrony
- role: frzk.chrony

0 comments on commit ecd1367

Please sign in to comment.
You can’t perform that action at this time.