Merge pull request #161 from xornet-sl/maintenance-0.20.x
[racktables] / .travis.yml
1 language: php
2
3 git:
4 quiet: true
5
6 php:
7 - '5.4'
8 - '5.5'
9 - '5.6'
10 - '7.0'
11
12 services:
13 - mysql
14
15 before_script:
16 - mysql -u root -e "CREATE DATABASE racktables_unittest CHARACTER SET utf8 COLLATE utf8_general_ci;"
17 - mysql -u root -e "GRANT ALL PRIVILEGES ON racktables_unittest.* TO racktables@localhost IDENTIFIED BY 'travistest';"
18 - echo "<?php" > wwwroot/inc/secret.php
19 - echo "\$pdo_dsn = 'mysql:host=127.0.0.1;port=3306;dbname=racktables_unittest';" >> wwwroot/inc/secret.php
20 - echo "\$db_username = 'racktables';" >> wwwroot/inc/secret.php
21 - echo "\$db_password = 'travistest';" >> wwwroot/inc/secret.php
22 - echo "?>" >> wwwroot/inc/secret.php
23 - echo "<?php" > cli_install.php
24 - echo "require_once 'wwwroot/inc/pre-init.php';" >> cli_install.php
25 - echo "require_once 'wwwroot/inc/dictionary.php';" >> cli_install.php
26 - echo "require_once 'wwwroot/inc/config.php';" >> cli_install.php
27 - echo "require_once 'wwwroot/inc/install.php';" >> cli_install.php
28 - echo "ob_start();" >> cli_install.php
29 - echo "init_database_static();" >> cli_install.php
30 - echo "ob_end_clean();" >> cli_install.php
31 - echo "?>" >> cli_install.php
32 - php cli_install.php
33 - echo 'INSERT INTO UserAccount (user_id, user_name, user_password_hash) VALUES (1, "admin", SHA1("travistest"));' | mysql -u racktables -ptravistest racktables_unittest
34
35 script:
36 - ./tests/express.sh
37 - mysql -u racktables -ptravistest racktables_unittest < scripts/init-sample-racks.sql