mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-02-24 09:03:29 +07:00
Travis major changes:
- Use Vagrant + Docker - Test multiple Ansible versions
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
FROM williamyeh/ansible:debian8-onbuild
|
||||
|
||||
RUN apt-get update
|
||||
CMD ["sh", "tests/travis.sh"]
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user