Try variabilisation of script

This commit is contained in:
Laurent Destailleur 2013-09-09 12:12:05 +02:00
parent afea278db2
commit 2a2cfa168e

View File

@ -21,9 +21,10 @@ before_script:
- echo Home dir is `echo ~`
- echo Create dir $(pwd)/htdocs/documents
- mkdir -p $(pwd)/htdocs/documents/admin/temp;
- touch /home/travis/build/Dolibarr/dolibarr/htdocs/documents/dolibarr.log;
- chmod -R a+rwx /home/travis/build/Dolibarr/dolibarr/htdocs/documents;
- find /home/travis/build/Dolibarr/dolibarr/htdocs/documents -exec ls -alrt {} \;
- touch $(pwd)/htdocs/documents/dolibarr.log;
- chmod a+rwx /home; chmod a+rwx /home/travis; chmod a+rwx /home/travis/build;
- chmod -R a+rwx $(pwd);
- find $(pwd)/htdocs/documents -exec ls -alrt {} \;
- echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
@ -34,14 +35,14 @@ before_script:
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE myapp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS myapp_test;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS myapp_test;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < /home/travis/build/Dolibarr/dolibarr/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi"
- echo Create config file htdocs/conf/conf.php
- echo '<?php ' > htdocs/conf/conf.php
- sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then echo '$'dolibarr_main_db_type=\'mysqli\'';' >> htdocs/conf/conf.php; fi"
- echo '$'dolibarr_main_url_root=\'http://localhost/\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_document_root=\'/home/travis/build/Dolibarr/dolibarr/htdocs\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_data_root=\'/home/travis/build/Dolibarr/dolibarr/htdocs/documents\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_document_root=\'$(pwd)/htdocs\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_data_root=\'$(pwd)/htdocs/documents\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_db_host=\'localhost\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_db_name=\'myapp_test\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_db_user=\'travis\'';' >> htdocs/conf/conf.php
@ -53,7 +54,6 @@ before_script:
- sudo apt-get update > /dev/null
- sudo apt-get install -y --force-yes apache2 libapache2-mod-php5 php5-curl php5-mysql php5-pgsql php5-intl
- sudo sed -i -e "s,/var/www,$(pwd)/htdocs,g" /etc/apache2/sites-available/default
- sudo sed -i -e "s,/var/www,$(pwd)/htdocs,g" /etc/apache2/sites-available/default
- echo Show default virtual host
- sudo cat /etc/apache2/sites-available/default
- sudo /etc/init.d/apache2 restart
@ -71,7 +71,7 @@ script: phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml
after_script:
- Output dolibarr log file
- cat /home/travis/build/Dolibarr/dolibarr/htdocs/documents/dolibarr.log
- cat $(pwd)/htdocs/documents/dolibarr.log
- Output apache log file
- sudo cat /var/log/apache2/error.log
- echo End travis