Travis maanges now PHP version

pull/5/head
Emilien Mantel 2016-01-22 16:29:43 +01:00
parent 862848c7f8
commit 2fa6bc2846
3 changed files with 15 additions and 6 deletions

View File

@ -1,5 +1,5 @@
FROM williamyeh/ansible:debian8-onbuild FROM williamyeh/ansible:debian8-onbuild
RUN apt-get update RUN apt-get update
CMD ["sh", "tests/test.sh"] CMD ["sh", "tests/test.sh", "5.6"]

View File

@ -1,6 +1,5 @@
FROM williamyeh/ansible:debian8-onbuild FROM williamyeh/ansible:debian8-onbuild
RUN apt-get update RUN apt-get update && ansible-galaxy install HanXHX.dotdeb
RUN ansible-galaxy install HanXHX.dotdeb CMD ["sh", "tests/test.sh", "7.0"]
CMD ["sh", "tests/test.sh"]

View File

@ -5,17 +5,27 @@
DIR=$( dirname $0 ) DIR=$( dirname $0 )
INVENTORY_FILE="$DIR/inventory" INVENTORY_FILE="$DIR/inventory"
PLAYBOOK="$DIR/test.yml" PLAYBOOK="$DIR/test.yml"
ANSIBLE_ARG=""
set -ev set -ev
# Only for travis
if [ -n "$1" ]
then
ANSIBLE_ARG="--extra-vars 'php_version=$1'"
fi
ansible --version
# Check syntax # Check syntax
ansible-playbook -i $INVENTORY_FILE -c local --syntax-check -vv $PLAYBOOK ansible-playbook -i $INVENTORY_FILE -c local --syntax-check -vv $PLAYBOOK
# Check role # Check role
ansible-playbook -i $INVENTORY_FILE -c local --sudo -vv $PLAYBOOK ansible-playbook -i $INVENTORY_FILE -c local $ANSIBLE_ARG --become -vv $PLAYBOOK
# Check indempotence # Check indempotence
ansible-playbook -i $INVENTORY_FILE -c local --sudo -vv $PLAYBOOK \ ansible-playbook -i $INVENTORY_FILE -c local $ANSIBLE_ARG --become -vv $PLAYBOOK \
| grep -q 'changed=0.*failed=0' \ | grep -q 'changed=0.*failed=0' \
&& (echo 'Idempotence test: pass' && exit 0) \ && (echo 'Idempotence test: pass' && exit 0) \
|| (echo 'Idempotence test: fail' && exit 1) || (echo 'Idempotence test: fail' && exit 1)