-
Notifications
You must be signed in to change notification settings - Fork 12
/
.travis.yml
executable file
·121 lines (96 loc) · 3.6 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
services: docker
env:
# - distro: centos7
# - distro: centos6
# - distro: fedora27
# - distro: ubuntu1604
# - distro: ubuntu1404
# - distro: ubuntu1204
- distro: debian8
playbook: test-mariadb10-3.yml
MYSQL_ROOT_LOGIN: "'-u admin -ptravis'"
MYSQL_VERSION: 10.3
- distro: ubuntu1804
playbook: test-mariadb10-3.yml
MYSQL_ROOT_LOGIN: "'-u admin -ptravis'"
MYSQL_VERSION: 10.3
- distro: ubuntu1604
playbook: test-mariadb10-3.yml
MYSQL_ROOT_LOGIN: "'-u admin -ptravis'"
MYSQL_VERSION: 10.3
- distro: debian9
playbook: test-admin-with-password.yml
MYSQL_ROOT_LOGIN: "'-u admin -ptravis'"
MYSQL_VERSION: 10.3
- distro: debian9
playbook: test-admin-without-password.yml
MYSQL_ROOT_LOGIN: "'-u admin'"
MYSQL_VERSION: 10.3
- distro: debian9
playbook: test-root-with-password.yml
MYSQL_ROOT_LOGIN: "'-u root -ptravis'"
MYSQL_VERSION: 10.3
- distro: debian9
playbook: test-root-without-password.yml
MYSQL_ROOT_LOGIN: "'-u root'"
MYSQL_VERSION: 10.3
- distro: debian9
playbook: test-mariadb10-2.yml
MYSQL_ROOT_LOGIN: "'-u admin -ptravis'"
MYSQL_VERSION: 10.2
script:
# Configure test script so we can run extra tests after playbook is run.
- export container_id=$(date +%s)
- export cleanup=false
- export reuse=${REUSE:-false}
- export DOCKER="docker exec --tty ${container_id} env TERM=xterm"
# Download test shim.
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/tschifftner/4078cf2a8429d967d5e100649ff2caa9/raw/
- chmod +x ${PWD}/tests/test.sh
# Prepare for upgrade test (No upgrade supported yet!)
# - |
# if [ "${playbook}" == "test-upgrade.yml" ]; then
# playbook=test-mariadb10-2.yml ${PWD}/tests/test.sh
# ${DOCKER} mysql --version | grep '10.2'
# fi
# Run tests.
- ${PWD}/tests/test.sh
# Make sure mariadb service is running
- ${DOCKER} systemctl --no-pager status mysql | grep "running"
# Make sure correct version is installed
- ${DOCKER} mysql --version | grep "${MYSQL_VERSION}"
# Check to make sure we can connect to MySQL via Unix socket.
- >
${DOCKER} mysql ${MYSQL_ROOT_LOGIN} -e 'show databases;' | grep -q 'performance_schema'
&& (echo 'Connecting mariadb via unix socket.' && exit 0)
|| (echo 'Cannot connect mariadb via unix socket.' && exit 1)
# Check to make sure we can connect to MySQL via TCP.
- >
${DOCKER} mysql ${MYSQL_ROOT_LOGIN} -h 127.0.0.1 -e 'show databases;' | grep -q 'performance_schema'
&& (echo 'Connecting mariadb via TCP.' && exit 0)
|| (echo 'Cannot connect mariadb via TCP.' && exit 1)
# Check travis user and database
- >
${DOCKER} mysql -u supertravis -ptravis -e 'show databases;'
| grep -q 'travis_testdb'
&& (echo 'MariaDb running normally' && exit 0)
|| (echo 'MariaDb not running' && exit 1)
# Check normal travis user and database
- >
${DOCKER} mysql -u normaltravis -ptravis -e 'show databases;'
| grep -q 'travis_testdb'
&& (echo 'MariaDb running normally' && exit 0)
|| (echo 'MariaDb not running' && exit 1)
after_failure:
- ${DOCKER} ls -lah /var/log
- ${DOCKER} cat /var/log/mysql/error.log
- ${DOCKER} systemctl --no-pager status mysql
- ${DOCKER} mysql --version
- ${DOCKER} mysql ${MYSQL_ROOT_LOGIN} -e 'show databases;'
- ${DOCKER} mysql ${MYSQL_ROOT_LOGIN} -h 127.0.0.1 -e 'show databases;'
- ${DOCKER} mysql -u supertravis -ptravis -e 'show databases;'
- ${DOCKER} mysql -u normaltravis -ptravis -e 'show databases;'
notifications:
slack: ambimax:2MlPTX9bY9aPxCPhJGxHKIT6
webhooks: https://galaxy.ansible.com/api/v1/notifications/