Travis major changes:

- Use Vagrant + Docker
- Test multiple Ansible versions
This commit is contained in:
Emilien Mantel
2017-06-05 16:21:47 +02:00
parent 3ae791ec47
commit eb0bdcad6f
6 changed files with 88 additions and 69 deletions

View File

@@ -1,4 +0,0 @@
FROM williamyeh/ansible:debian8-onbuild
RUN apt-get update
CMD ["sh", "tests/travis.sh"]

View File

@@ -229,7 +229,7 @@
https_proxy_protocol_port: [20443]
template: '_base'
ssl_name: 'test-ssl.local'
nginx_dh_length: 2048
nginx_dh_length: 1024
roles:
- ../../
post_tasks:

View File

@@ -1,25 +0,0 @@
#!/bin/sh
# Thanks to https://servercheck.in/blog/testing-ansible-roles-travis-ci-github
DIR=$( dirname $0 )
PLAYBOOK="$DIR/test.yml"
set -ev
ANSIBLE_VARS="{ nginx_php56: $NGINX_PHP56, nginx_php70: $NGINX_PHP70, nginx_backports: $NGINX_BACKPORTS, dotdeb: $DOTDEB }"
echo $ANSIBLE_VARS
# Check syntax
ansible-playbook -i localhost, -c local --syntax-check -vv $PLAYBOOK
# Check role
ansible-playbook -i localhost, -c local -e "$ANSIBLE_VARS" --sudo -vv $PLAYBOOK
# Check indempotence
ansible-playbook -i localhost, -c local -e "$ANSIBLE_VARS" --sudo -vv $PLAYBOOK \
| grep -q 'changed=0.*failed=0' \
&& (echo 'Idempotence test: pass' && exit 0) \
|| (echo 'Idempotence test: fail' && exit 1)