From 9b55e917111eb69c60621745693b17fe3c233780 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Fri, 22 Jan 2016 17:17:38 +0100 Subject: [PATCH] Travis should load php version with group --- tests/debian-jessie-php-5.6.Dockerfile | 2 +- tests/debian-jessie-php-7.0.Dockerfile | 2 +- tests/inventory | 6 ++++++ tests/test.sh | 4 ++-- tests/test.yml | 6 ++---- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/debian-jessie-php-5.6.Dockerfile b/tests/debian-jessie-php-5.6.Dockerfile index 9a4908a..bca4a55 100644 --- a/tests/debian-jessie-php-5.6.Dockerfile +++ b/tests/debian-jessie-php-5.6.Dockerfile @@ -1,5 +1,5 @@ FROM williamyeh/ansible:debian8-onbuild RUN apt-get update -CMD ["sh", "tests/test.sh", "5.6"] +CMD ["sh", "tests/test.sh", "php-5.6"] diff --git a/tests/debian-jessie-php-7.0.Dockerfile b/tests/debian-jessie-php-7.0.Dockerfile index 0d61e33..8bc0393 100644 --- a/tests/debian-jessie-php-7.0.Dockerfile +++ b/tests/debian-jessie-php-7.0.Dockerfile @@ -1,5 +1,5 @@ FROM williamyeh/ansible:debian8-onbuild RUN apt-get update && ansible-galaxy install HanXHX.dotdeb -CMD ["sh", "tests/test.sh", "7.0"] +CMD ["sh", "tests/test.sh", "php-7.0"] diff --git a/tests/inventory b/tests/inventory index 2fbb50c..f226ed6 100644 --- a/tests/inventory +++ b/tests/inventory @@ -1 +1,7 @@ localhost + +[php-5.6] +localhost + +[php-7.0] +localhost diff --git a/tests/test.sh b/tests/test.sh index 3f65d0b..b62475e 100644 --- a/tests/test.sh +++ b/tests/test.sh @@ -5,14 +5,14 @@ DIR=$( dirname $0 ) INVENTORY_FILE="$DIR/inventory" PLAYBOOK="$DIR/test.yml" -ANSIBLE_ARG="" +ANSIBLE_ARG="localhost" set -ev # Only for travis if [ -n "$1" ] then - ANSIBLE_ARG="--extra-vars 'php_version=$1'" + ANSIBLE_ARG="--limit $1" fi diff --git a/tests/test.yml b/tests/test.yml index d02ee88..6d7b98d 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -1,13 +1,11 @@ --- # On Debian Jessie, we need Dotdeb for PHP 7.0 -- hosts: all +- hosts: php-7.0 roles: - role: HanXHX.dotdeb when: > - ansible_distribution_major_version | version_compare(8, 'eq') and - php_version is defined and - php_version | version_compare('7.0', 'ge') + ansible_distribution_major_version | version_compare(8, 'eq') - hosts: all vars: