forked from Cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
71 lines (64 loc) · 3.04 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
language: php
services:
- mysql
matrix:
include:
- php: 7.2
dist: bionic
- php: 7.3
dist: bionic
- php: 7.4
dist: bionic
- php: nightly
dist: bionic
fast_finish: true
allow_failures:
- php: 7.4
- php: nightly
before_install:
- sudo apt-get update > /dev/null
install:
- sudo apt-get install apache2 php-fpm php-mysql php-gd php-ldap php-gmp rrdtool snmp
- sudo a2enmod proxy_fcgi setenvif actions alias
- sudo find /etc/apache2
# configure apache virtual hosts
- sudo cp -f tests/tools/cacti.conf /etc/apache2/sites-available/000-default.conf
# setup link for php legacy
- sudo ln -s ~/.phpenv/versions/$(phpenv version-name)/bin/php /bin/php
# set some required variables
- echo 'cgi.fix_pathinfo = 1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo 'date.timezone = "America/New_York"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
# copy the Cacti website to the correct direcotry
- sudo /bin/cp -rpf /home/travis/build/Cacti/cacti /var/www/html/
# change ownership on the Cacti directory
- sudo chown -R www-data:www-data /var/www/html/cacti
# enable php-fpm
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- sudo sed -i -e 's,nobody,www-data,g' ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
# restart apache
- sudo service apache2 restart
# start php-fpm
- sudo ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# run syntax check
- if find . -name '*.php' -exec php -l {} 2>&1 \; | grep -iv 'no syntax errors detected'; then exit 1; fi
before_script:
- mysql -e 'CREATE DATABASE cacti;'
- mysql -e "CREATE USER 'cactiuser'@'localhost' IDENTIFIED BY 'cactiuser';"
- mysql -e "GRANT ALL PRIVILEGES ON cacti.* TO 'cactiuser'@'localhost';"
- mysql -e "FLUSH PRIVILEGES;"
- mysql cacti < cacti.sql
- mysql -e "INSERT INTO settings (name, value) VALUES ('path_php_binary', '/bin/php')" cacti
- mv include/config.php.dist include/config.php
script:
- php tests/tools/check_install_code.php
- bash tests/tools/check_cli_version.sh
- php cli/install_cacti.php --accept-eula --install --force
- sudo bash tests/tools/check_all_pages.sh
notifications:
email:
on_success: change
on_failure: always
recipients:
- developers@cacti.net
slack:
secure: ZY2XMrAUZO0UbZY0MvRd+sD60+fnvluUVm5kxXII/+waDpEutLmWnNclJo+96KI0zXZwsYcdahmHc4lnNiJhZSGcZN3QWp/bAophgT5b3ly4k2HzyMcG39pK9v1ue2tws4yB9OPDMcTyq7XPEcWxQT3q7Ca7hAYVCOZSnAt17OTe6HgasjvJtekDog+dK0iI3TB9BIrazWw4e2eoFpnVnPtTPo8qI0uh3Aihcfg12ETzssLD4hvyx6eBmaQBHn0jhvuw3AfzD82T4g5MHaLrGGz3q8tD+iZPGEIp4XBxeDtFkYx+MdY6IFWlYXa0mCVE1H7ChQjk3VMhHGxZMFzUOyxn61CGPJLGknn98qnrgj7bXRq073RlzirnyvRmxilFeJlXNM3KiVie5e3Abl7u5REQMfvs8slETLE7bQ7MJwyF6wWamaZWzoeIGS+ZEdEAdZK0LoTApHsk4rh1ciJZP6ECn6S+1bkAfRDPoyo9LOjqL32oSl6S3+/hGVHTJr1e9fEX+iwjLwA6w3JmbvhfGY/eLudRz+QqY0MlRiBp9bdnkLoneS6gmKhz5n6bzaDZxZ4xmLWY4aSX1rLbOyJZAss2m0vvaxg7QnJ6LjHDWeQUHcDLsklYBAqK8IAzBEDHzOic+9GOvtWyPWXBktR+8bNn+C0oFrHCykFo8dDv8Nc=