.travis.yml 5.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. language: php
  2. php:
  3. #- 5.4 // Removed because of Chash dependencies on PHP 5.5
  4. - 5.5
  5. - 5.6
  6. - 7.0
  7. before_install:
  8. #- sudo apt-get install python-software-properties
  9. #- sudo add-apt-repository ppa:ondrej/php5 -y
  10. - sudo apt-get update -qq
  11. - sudo apt-get install -qq mysql-server
  12. - sudo apt-get install -qq apache2 libapache2-mod-fastcgi
  13. # enable php-fpm
  14. - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
  15. - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then 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
  16. - sudo a2enmod rewrite actions fastcgi alias
  17. - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  18. - echo "memory_limit = 2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  19. - echo "phar.readonly = 0" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  20. - echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  21. - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
  22. # configure apache virtual hosts
  23. - sudo cp -f tests/travis-apache /etc/apache2/sites-available/default
  24. - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
  25. - sudo service apache2 restart
  26. # Install additional PHP packages (check http://docs.travis-ci.com/user/ci-environment/#CI-environment-OS
  27. # for pre-installed packages)
  28. #- sudo apt-get install -qq php5-imagick
  29. # Following http://docs.travis-ci.com/user/languages/php/#PHP-installation,
  30. # php is compiled with --enable-fpm, so no install of FPM is needed.
  31. # However, not installing it generates errors with service php5-fpm restart
  32. # further down (need to use php-fpm without 5)
  33. #- sudo apt-get install -qq php5-cli php5-fpm
  34. before_script:
  35. #- which composer
  36. #- php -d memory_limit=2G /usr/bin/composer update
  37. #- php -d memory_limit=2G /home/travis/.phpenv/shims/composer update
  38. # Previously, fxp/composer-asset-plugin was required but was causing a lot of trouble updating. Now it's disabled.
  39. #- composer global require "fxp/composer-asset-plugin:1.0.3"
  40. # You can either use the composer install method and face the Github limit
  41. #- composer install -n
  42. - composer update
  43. # ...OR you can try the option --prefer-dist, that will reuse composer packages cache
  44. #- composer update --prefer-dist
  45. # ...OR you can try the --prefer-source option to download from source whenever it's possible (but it's much slower)
  46. #- composer update --prefer-source
  47. # ...OR use the proxy repository to download the necessary dependencies, but this repo is not always updated
  48. #- git clone -b 1.10.x --depth=1 https://github.com/ywarnier/chamilo-vendors.git
  49. #- sudo mv chamilo-vendors/vendor .
  50. #- sudo mv chamilo-vendors/web .
  51. #- sudo mv chamilo-vendors/composer.lock .
  52. #- sudo rm -rf chamilo-vendors
  53. # Continue...
  54. - phpenv config-add tests/travis-php-config.ini
  55. # enable php-fpm
  56. # configure apache virtual hosts
  57. - php -v
  58. # install Chash, a database, and then install Chamilo
  59. - git clone https://github.com/chamilo/chash
  60. - cd chash
  61. #- composer install
  62. - composer update
  63. - php -d phar.readonly=0 createPhar.php
  64. - chmod +x chash.phar
  65. - sudo mv chash.phar /usr/local/bin/chash
  66. #- cd ..
  67. #- git clone -b nophpversioncheck --single-branch https://github.com/ywarnier/chamilo-cli-install.git
  68. #- cp chamilo-cli-install/chamilo-cli-installer.php main/install/
  69. #- mysql -u root -e 'create database chamilo'
  70. #- sudo chmod -R 0777 app/config app main/default_course_document/images main/lang
  71. #- cd main/install/
  72. #- sudo php5 chamilo-cli-installer.php -l admin -p admin -U travis -u 'http://localhost/' -X travis -L english -z 'admin@example.com' -f 'John' -g 'Doe' -b '555-5555' -c 'Test campus' -y 'Chamilo' -x 'https://chamilo.org'
  73. #- cd ../..
  74. # install Chamilo with Chash - see reference https://github.com/sonnym/travis-ci-drupal-module-example/blob/master/.travis.yml
  75. # - cd /home/travis/build/chamilo/chamilo-lms
  76. # There's an issue with Chash, starting in version 1.10, whereby PHP CLI on Travis-ci is PHP5.3, whatever the version you ask for.
  77. # This effectively breaks the installer and renders these tests useless. We are looking for a solution (for example using containers)
  78. - sudo php -d date.timezone="Europe/Paris" chash.php chash:chamilo_install 1.11.x /home/travis/build/chamilo/chamilo-lms --download-package --no-interaction --only-download-package
  79. - cd /home/travis/build/chamilo/chamilo-lms
  80. - composer update
  81. - sudo php -d date.timezone="Europe/Paris" /home/travis/build/chamilo/chamilo-lms/chash/chash.php chash:chamilo_install 1.11.x /home/travis/build/chamilo/chamilo-lms --no-interaction --sitename="Chamilo" --site_url="http://localhost/" --institution="Chamilo" --institution_url="https://chamilo.org" --encrypt_method="sha1" --firstname="John" --lastname="Doe" --language="english" --driver="pdo_mysql" --host="localhost" --port="3306" --dbname="chamilo" --dbuser="root" --permissions_for_new_directories="0777" --permissions_for_new_files="0666" --linux-user="www-data" --linux-group="www-data" --username="admin" --password="admin" --email="admin@example.com" --phone="555-5555"
  82. script:
  83. # - phpunit -c tests/phpunit
  84. # pwd shows /home/travis/build/chamilo/chamilo-lms
  85. - cd tests/behat && ../../vendor/behat/behat/bin/behat -v
  86. # configure notifications (email, IRC, campfire etc)
  87. notifications:
  88. # IRC notifications - disabled for creating a lot of noise on the channel
  89. irc: "irc.freenode.org#chamilodev"