forked from geerlingguy/ansible-role-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
74 lines (64 loc) · 2.37 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
services: docker
env:
# Test package install on all supported OSes.
- distro: centos7
playbook: test.yml
php_version: 7.0
- distro: fedora27
playbook: test.yml
php_version: 7.1
- distro: debian9
playbook: test.yml
php_version: 7.0
- distro: debian8
playbook: test.yml
php_version: 7.0
- distro: ubuntu1804
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
# Only test source install on latest supported OSes.
- distro: centos7
playbook: test-source.yml
php_version: 7.1.17
- distro: ubuntu1804
playbook: test-source.yml
php_version: 7.1.17
script:
# Configure test script so we can run extra tests after playbook is run.
- export container_id=$(date +%s)
- export cleanup=false
# Download test shim.
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/
- chmod +x ${PWD}/tests/test.sh
# Run tests.
- ${PWD}/tests/test.sh
# 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'
- '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}"'
# Ensure PHP configurations have taken effect.
- docker exec --tty ${container_id} env TERM=xterm php -i | grep 'memory_limit.*192'
# 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"|"ubuntu1804")
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
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/