ansible-role-php/.travis.yml

69 lines
2.2 KiB
YAML
Raw Normal View History

2014-04-23 18:29:49 +02:00
---
services: docker
2014-04-23 18:29:49 +02:00
env:
2016-02-16 17:25:40 +01:00
# Test package install on all supported OSes.
- distro: centos7
2016-09-14 23:22:10 +02:00
playbook: test.yml
php_version: 7.0
2016-09-18 01:45:10 +02:00
- distro: fedora24
playbook: test.yml
2016-09-18 01:45:10 +02:00
php_version: 5.6
2017-05-15 06:10:58 +02:00
- distro: debian8
playbook: test.yml
php_version: 7.0
- distro: ubuntu1604
playbook: test.yml
php_version: 7.0
- distro: ubuntu1404
playbook: test.yml
php_version: 7.0
2016-09-14 23:22:10 +02:00
# Only test source install on latest supported OSes.
- distro: centos7
playbook: test-source.yml
php_version: 7.1.9
2016-09-14 23:22:10 +02:00
- distro: ubuntu1604
playbook: test-source.yml
php_version: 7.1.9
2016-09-14 23:22:10 +02:00
2014-04-23 18:29:49 +02:00
script:
# Configure test script so we can run extra tests after playbook is run.
- export container_id=$(date +%s)
- export cleanup=false
2014-04-23 18:29:49 +02:00
# Download test shim.
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/
- chmod +x ${PWD}/tests/test.sh
2016-02-16 17:25:40 +01:00
# Run tests.
- ${PWD}/tests/test.sh
2014-04-23 18:29:49 +02:00
2016-02-16 17:25:40 +01:00
# Ensure PHP is installed and at the right version.
- 'docker exec --tty ${container_id} env TERM=xterm which php'
- 'docker exec --tty ${container_id} env TERM=xterm test -x /usr/bin/php'
2015-05-26 17:32:11 +02:00
- 'docker exec --tty ${container_id} env TERM=xterm php --version'
- 'docker exec --tty ${container_id} env TERM=xterm /usr/bin/php --version | grep -qF "PHP ${php_version}"'
2015-06-01 04:05:08 +02:00
# Ensure PHP configurations have taken effect.
- docker exec --tty ${container_id} env TERM=xterm php -i | grep 'memory_limit.*192'
2016-02-08 21:09:43 +01:00
# Check the status of PHP-FPM.
- |
if [ "${playbook}" == "test.yml" ]; then
case "${distro}" in
"centos7"|"fedora24")
docker exec --tty ${container_id} env TERM=xterm systemctl --no-pager status php-fpm status
docker exec --tty ${container_id} env TERM=xterm systemctl --no-pager status php-fpm status | grep -qF "fpm.service; enabled"
;;
"debian8"|"ubuntu1604")
docker exec --tty ${container_id} env TERM=xterm systemctl --no-pager status php${php_version}-fpm status
docker exec --tty ${container_id} env TERM=xterm systemctl --no-pager status php${php_version}-fpm status | grep -qF "fpm.service; enabled"
;;
esac
fi
2017-05-15 06:10:58 +02:00
2016-02-08 21:09:43 +01:00
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/