Skip to content

Commit

Permalink
Travis: before_script use here-doc for bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
dregad committed Oct 21, 2013
1 parent 0030145 commit 15beef1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/travis_before_script.sh
@@ -1,5 +1,9 @@
#!/bin/bash

# Global variables initialization
MANTIS_BOOTSTRAP=tests/bootstrap.php


# create database
if [ $DB = 'mysql' ]; then
mysql -e 'create database bugtracker;'
Expand Down Expand Up @@ -51,12 +55,18 @@ curl --data "install=2&hostname=localhost&db_username=${DB_USER}&db_type=${DB}&d

echo " \$g_crypto_master_salt='1234567890abcdef'; " | sudo tee -a config_inc.php


# create the first project
if [ $DB = 'mysql' ]; then
mysql -e "INSERT INTO mantis_project_table(name, inherit_global) VALUES('First project', 1)" bugtracker
elif [ $DB = 'pgsql' ]; then
psql -c "INSERT INTO mantis_project_table(name, inherit_global, description) VALUES('First project', 1, '')" -d bugtracker -U postgres
fi


# enable SOAP tests
echo "<?php \$GLOBALS['MANTIS_TESTSUITE_SOAP_ENABLED'] = true; \$GLOBALS['MANTIS_TESTSUITE_SOAP_HOST'] = 'http://localhost/api/soap/mantisconnect.php?wsdl';?>" > ./tests/bootstrap.php
cat <<-EOF >> $MANTIS_BOOTSTRAP
<?php
\$GLOBALS['MANTIS_TESTSUITE_SOAP_ENABLED'] = true;
\$GLOBALS['MANTIS_TESTSUITE_SOAP_HOST'] = 'http://localhost/api/soap/mantisconnect.php?wsdl';
EOF

0 comments on commit 15beef1

Please sign in to comment.