Try restore old travis script

This commit is contained in:
Laurent Destailleur 2022-09-20 19:36:47 +02:00
parent 2664f1bce0
commit af0c6c0600

View File

@ -4,8 +4,8 @@
# We use dist: xenial to have php 5.6+ available # We use dist: xenial to have php 5.6+ available
os: linux os: linux
#dist: xenial dist: xenial
dist: bionic #dist: bionic
language: php language: php
@ -18,41 +18,21 @@ services:
- mysql - mysql
- postgresql - postgresql
before_install:
- |
echo "Add ondrej PPA"
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
echo "Disabling Xdebug for composer"
export PHP_VERSION_NAME=$(phpenv version-name)
echo $PHP_VERSION_NAME
ls ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini
phpenv config-rm xdebug.ini
phpenv rehash
echo
addons: addons:
# Force postgresql to 9.4 (the oldest availablable on xenial) # Force postgresql to 9.4 (the oldest availablable on xenial)
postgresql: '10' postgresql: '9.4'
apt: apt:
sources: sources:
# To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/ # To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/
- pgdg-xenial - pgdg-xenial
- sourceline: 'ppa:ondrej/php'
packages: packages:
# We need a webserver to test the webservices # We need a webserver to test the webservices
# Let's install Apache with. # Let's install Apache with.
- apache2 - apache2
# mod_php is not supported by Travis. Add fcgi. We install FPM later on. # mod_php is not supported by Travis. Add fcgi. We install FPM later on.
#- libapache2-mod-fastcgi - libapache2-mod-fastcgi
# We need pgloader for import mysql database into pgsql # We need pgloader for import mysql database into pgsql
- pgloader - pgloader
- php5.6
- php5.6-pgsql
- php5.6-mysqli
- php5.6-xml
env: env:
global: global:
@ -92,6 +72,13 @@ notifications:
on_failure: always on_failure: always
use_notice: true use_notice: true
before_install:
- |
echo "Disabling Xdebug for composer"
export PHP_VERSION_NAME=$(phpenv version-name)
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini
phpenv config-rm xdebug.ini
echo
install: install:
- | - |
@ -251,10 +238,6 @@ before_script:
- echo "Setting up Apache + FPM" - echo "Setting up Apache + FPM"
# setup link for php legacy
- sudo ln -s ~/.phpenv/versions/$(phpenv version-name)/bin/php /bin/php
# install apache web server
- sudo apt-get install apache2 php-fpm php-mysql php-pgsql php-gd php-ldap php-xml php-mbstring libapache2-mod-php
# enable php-fpm # enable php-fpm
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- | - |
@ -262,11 +245,10 @@ before_script:
# Copy the included pool # Copy the included pool
sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
fi fi
- sudo a2enmod proxy_fcgi rewrite setenvif cgi alias - sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars - sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
#- sudo chown -R travis:travis /var/lib/apache2/fastcgi - sudo chown -R travis:travis /var/lib/apache2/fastcgi
# start php-fpm
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# configure apache virtual hosts # configure apache virtual hosts
- sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf - sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf
@ -448,8 +430,8 @@ script:
- | - |
echo "Unit testing" echo "Unit testing"
# Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log and apache error.log file. # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file.
set +e set -e
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
phpunitresult=$? phpunitresult=$?
echo "Phpunit return code = $phpunitresult" echo "Phpunit return code = $phpunitresult"
@ -461,9 +443,6 @@ after_script:
ls $TRAVIS_BUILD_DIR/documents ls $TRAVIS_BUILD_DIR/documents
#cat $TRAVIS_BUILD_DIR/documents/dolibarr.log #cat $TRAVIS_BUILD_DIR/documents/dolibarr.log
sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
echo "After script - Output last lines of apache error.log"
ls /var/log/apache2
sudo tail -n 50 /var/log/apache2/travis_error_log
after_success: after_success:
- | - |
@ -472,14 +451,14 @@ after_success:
after_failure: after_failure:
- | - |
echo Failure detected, so we show samples of log to help diagnose echo Failure detected, so we show samples of log to help diagnose
# This part of code is executed only if the command that fails are enclosed with set +e # This part of code is executed only if previous command that fails are enclosed with set +e
# Show upgrade log files # Upgrade log files
for ficlog in `ls $TRAVIS_BUILD_DIR/*.log` for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
do do
echo "Debugging informations for file $ficlog" echo "Debugging informations for file $ficlog"
#cat $ficlog #cat $ficlog
done done
# Show Apache log file # Apache log file
echo "Debugging informations for file apache error.log" echo "Debugging informations for file apache error.log"
sudo cat /var/log/apache2/travis_error_log sudo cat /var/log/apache2/travis_error_log
if [ "$DEBUG" = true ]; then if [ "$DEBUG" = true ]; then