Update Travis CI
This commit is contained in:
56
.travis.yml
56
.travis.yml
@@ -1,8 +1,9 @@
|
|||||||
language: php
|
language: php
|
||||||
dist: trusty
|
dist: bionic
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
php:
|
php:
|
||||||
- "7.3"
|
- 7.3
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
@@ -11,34 +12,49 @@ branches:
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
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
|
- php: 7.3
|
||||||
env: deps=highest
|
env: "DOCKER_MYSQL_TYPE=mariadb DOCKER_MYSQL_VERSION=10.4"
|
||||||
|
|
||||||
mysql:
|
|
||||||
database: froxlor010
|
|
||||||
username: root
|
|
||||||
encoding: utf8
|
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
update: true
|
update: true
|
||||||
|
|
||||||
service:
|
before_install:
|
||||||
- mysql
|
- 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:
|
install:
|
||||||
- mysql -e 'CREATE DATABASE IF NOT EXISTS froxlor010'
|
- mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI -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 -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI -e "GRANT ALL ON froxlor010.* TO 'froxlor010'@'%' IDENTIFIED BY 'fr0xl0r.TravisCI';"
|
||||||
- mysql -u root -pfr0xl0r.TravisCI froxlor010 < install/froxlor.sql
|
- mysql -h 127.0.0.1 --protocol=TCP -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
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ant phpunit
|
- ant phpunit
|
||||||
|
|
||||||
after_success:
|
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:
|
notifications:
|
||||||
irc: "irc.freenode.org#froxlor"
|
irc: "irc.freenode.org#froxlor"
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class MysqlsTest extends TestCase
|
|||||||
|
|
||||||
// test connection
|
// test connection
|
||||||
try {
|
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);
|
unset($test_conn);
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
$this->fail($e->getMessage());
|
$this->fail($e->getMessage());
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ if (@php_sapi_name() !== 'cli') {
|
|||||||
$userdata_content = "<?php
|
$userdata_content = "<?php
|
||||||
\$sql['user'] = 'froxlor010';
|
\$sql['user'] = 'froxlor010';
|
||||||
\$sql['password'] = '$pwd';
|
\$sql['password'] = '$pwd';
|
||||||
\$sql['host'] = 'localhost';
|
\$sql['host'] = '127.0.0.1';
|
||||||
\$sql['db'] = 'froxlor010';
|
\$sql['db'] = 'froxlor010';
|
||||||
\$sql_root[0]['user'] = 'root';
|
\$sql_root[0]['user'] = 'root';
|
||||||
\$sql_root[0]['password'] = '$rpwd';
|
\$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_root[0]['caption'] = 'Test default';
|
||||||
\$sql['debug'] = true;" . PHP_EOL;
|
\$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.documentroot_use_default_value', '1', true);
|
||||||
Settings::Set('system.hostname', 'dev.froxlor.org', true);
|
Settings::Set('system.hostname', 'dev.froxlor.org', true);
|
||||||
Settings::Set('system.nameservers', '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.use_ssl', '1', true);
|
||||||
Settings::Set('system.froxlordirectlyviahostname', '1', true);
|
Settings::Set('system.froxlordirectlyviahostname', '1', true);
|
||||||
Settings::Set('system.dns_createhostnameentry', '1', true);
|
Settings::Set('system.dns_createhostnameentry', '1', true);
|
||||||
|
|||||||
Reference in New Issue
Block a user