2014-04-23 18:29:49 +02:00
|
|
|
---
|
2016-09-25 22:50:37 +02:00
|
|
|
services: docker
|
2014-04-23 19:42:10 +02:00
|
|
|
|
2014-04-23 18:29:49 +02:00
|
|
|
env:
|
2016-02-16 17:25:40 +01:00
|
|
|
# Test package install on all supported OSes.
|
2016-09-14 22:46:27 +02:00
|
|
|
- distro: centos7
|
2016-09-14 23:22:10 +02:00
|
|
|
playbook: test.yml
|
2016-09-14 22:46:27 +02:00
|
|
|
php_version: 7.0
|
2016-09-18 01:45:10 +02:00
|
|
|
- distro: fedora24
|
2016-09-18 02:06:40 +02:00
|
|
|
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
|
2016-09-14 22:46:27 +02:00
|
|
|
- distro: ubuntu1604
|
|
|
|
playbook: test.yml
|
|
|
|
php_version: 7.0
|
|
|
|
- distro: ubuntu1404
|
|
|
|
playbook: test.yml
|
|
|
|
php_version: 7.0
|
2014-04-23 19:42:10 +02:00
|
|
|
|
2016-09-14 23:22:10 +02:00
|
|
|
# Only test source install on latest supported OSes.
|
|
|
|
- distro: centos7
|
|
|
|
playbook: test-source.yml
|
2017-09-22 05:26:28 +02:00
|
|
|
php_version: 7.1.9
|
2016-09-14 23:22:10 +02:00
|
|
|
- distro: ubuntu1604
|
|
|
|
playbook: test-source.yml
|
2017-09-22 05:26:28 +02:00
|
|
|
php_version: 7.1.9
|
2016-09-14 23:22:10 +02:00
|
|
|
|
2014-04-23 18:29:49 +02:00
|
|
|
script:
|
2017-04-02 16:49:19 +02:00
|
|
|
# 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
|
|
|
|
2017-04-02 16:49:19 +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
|
|
|
|
2017-04-02 16:49:19 +02: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.
|
2017-04-02 16:49:19 +02:00
|
|
|
- '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
|
|
|
|
2017-04-02 16:49:19 +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
|
|
|
|
2016-03-04 03:24:47 +01:00
|
|
|
# Ensure PHP configurations have taken effect.
|
2017-04-02 16:49:19 +02:00
|
|
|
- docker exec --tty ${container_id} env TERM=xterm php -i | grep 'memory_limit.*192'
|
2016-02-08 21:09:43 +01:00
|
|
|
|
2017-05-16 06:07:59 +02:00
|
|
|
# Check the status of PHP-FPM.
|
|
|
|
- |
|
2017-05-17 05:01:55 +02:00
|
|
|
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/
|