Update Travis CI

This commit is contained in:
Marc-André Kolly 2019-07-28 23:45:05 +02:00
parent d5e4182878
commit 4ef78df27f
No known key found for this signature in database
GPG Key ID: 1A41ACFD27AABF1F
3 changed files with 40 additions and 24 deletions

View File

@ -1,8 +1,9 @@
language: php
dist: trusty
dist: bionic
services:
- docker
php:
- "7.3"
- 7.3
branches:
only:
@ -11,34 +12,49 @@ branches:
matrix:
include:
# - php: 7.3
# env: "DOCKER_MYSQL_TYPE=mysql DOCKER_MYSQL_VERSION=5.6"
# - php: 7.3
# env: "DOCKER_MYSQL_TYPE=mysql DOCKER_MYSQL_VERSION=5.7"
# - php: 7.3
# env: "DOCKER_MYSQL_TYPE=mysql DOCKER_MYSQL_VERSION=8.0"
# - php: 7.3
# env: "DOCKER_MYSQL_TYPE=mariadb DOCKER_MYSQL_VERSION=10.3"
- php: 7.3
env: deps=highest
mysql:
database: froxlor010
username: root
encoding: utf8
env: "DOCKER_MYSQL_TYPE=mariadb DOCKER_MYSQL_VERSION=10.4"
addons:
apt:
update: true
service:
- mysql
before_install:
- export MYSQL_DATABASE=froxlor010
- docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=fr0xl0r.TravisCI -e MYSQL_DATABASE=$MYSQL_DATABASE -p 3306:3306 $DOCKER_MYSQL_TYPE:$DOCKER_MYSQL_VERSION
- sudo apt-get install -y ant
- >
export tries=0;
export max_tries=20;
while [[ true ]]; do
tries=$((tries + 1));
echo "waiting for database server to start up... [$tries]";
sleep 5;
# Now see that today's table is there, which would indicate that the cron job ran.
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI -s -e 'SHOW VARIABLES LIKE "%version%";'
look_exit=$?;
if [[ "$look_exit" = "0" ]]; then echo "Database server successfully started"; break; fi;
if [[ "$tries" -ge "$max_tries" ]]; then echo "Database server did not start in time"; exit 1; break; fi;
done;
before_script:
- mysql -e 'CREATE DATABASE IF NOT EXISTS froxlor010'
- echo "USE mysql;\nUPDATE user SET password=PASSWORD('fr0xl0r.TravisCI') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
- mysql -u root -pfr0xl0r.TravisCI froxlor010 < install/froxlor.sql
- mysql -u root -pfr0xl0r.TravisCI -e "CREATE USER 'froxlor010'@'localhost' IDENTIFIED BY 'fr0xl0r.TravisCI';"
- mysql -u root -pfr0xl0r.TravisCI -e "GRANT ALL ON froxlor010.* TO 'froxlor010'@'localhost';"
# - phpenv config-rm xdebug.ini
install:
- mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI -e "CREATE DATABASE IF NOT EXISTS froxlor010"
- mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI -e "GRANT ALL ON froxlor010.* TO 'froxlor010'@'%' IDENTIFIED BY 'fr0xl0r.TravisCI';"
- mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI froxlor010 < install/froxlor.sql
script:
- ant phpunit
- ant phpunit
after_success:
- bash <(curl -s https://codecov.io/bash) -f "build/logs/clover.xml"
- bash <(curl -s https://codecov.io/bash) -f "build/logs/clover.xml"
notifications:
irc: "irc.freenode.org#froxlor"

View File

@ -39,7 +39,7 @@ class MysqlsTest extends TestCase
// test connection
try {
$test_conn = new \PDO("mysql:host=localhost", 'test1sql1', $newPwd);
$test_conn = new \PDO("mysql:host=127.0.0.1", 'test1sql1', $newPwd);
unset($test_conn);
} catch (PDOException $e) {
$this->fail($e->getMessage());

View File

@ -19,11 +19,11 @@ if (@php_sapi_name() !== 'cli') {
$userdata_content = "<?php
\$sql['user'] = 'froxlor010';
\$sql['password'] = '$pwd';
\$sql['host'] = 'localhost';
\$sql['host'] = '127.0.0.1';
\$sql['db'] = 'froxlor010';
\$sql_root[0]['user'] = 'root';
\$sql_root[0]['password'] = '$rpwd';
\$sql_root[0]['host'] = 'localhost';
\$sql_root[0]['host'] = '127.0.0.1';
\$sql_root[0]['caption'] = 'Test default';
\$sql['debug'] = true;" . PHP_EOL;
@ -159,7 +159,7 @@ Settings::Set('system.ipaddress', '82.149.225.46', true);
Settings::Set('system.documentroot_use_default_value', '1', true);
Settings::Set('system.hostname', 'dev.froxlor.org', true);
Settings::Set('system.nameservers', 'dev.froxlor.org', true);
Settings::Set('system.mysql_access_host', 'localhost,127.0.0.1,2a01:440:1:12:82:149:225:46,82.149.225.46', true);
Settings::Set('system.mysql_access_host', 'localhost,127.0.0.1,172.17.0.1,2a01:440:1:12:82:149:225:46,82.149.225.46', true);
Settings::Set('system.use_ssl', '1', true);
Settings::Set('system.froxlordirectlyviahostname', '1', true);
Settings::Set('system.dns_createhostnameentry', '1', true);