.travis.yml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. # Install additional PHP packages (check http://docs.travis-ci.com/user/ci-environment/#CI-environment-OS
  14. # for pre-installed packages)
  15. #- sudo apt-get install -qq php5-imagick
  16. # Following http://docs.travis-ci.com/user/languages/php/#PHP-installation,
  17. # php is compiled with --enable-fpm, so no install of FPM is needed.
  18. # However, not installing it generates errors with service php5-fpm restart
  19. # further down (need to use php-fpm without 5)
  20. - sudo apt-get install -qq php5-cli php5-fpm
  21. before_script:
  22. - php5 -v
  23. - php5 -m
  24. - composer self-update
  25. # Previously, fxp/composer-asset-plugin was required but was causing a lot of trouble updating. Now it's disabled.
  26. #- composer global require "fxp/composer-asset-plugin:1.0.3"
  27. # You can either use the composer install method and face the Github limit
  28. #- composer install -n
  29. - composer update
  30. # ...OR you can try the option --prefer-dist, that will reuse composer packages cache
  31. #- composer update --prefer-dist
  32. # ...OR you can try the --prefer-source option to download from source whenever it's possible (but it's much slower)
  33. #- composer update --prefer-source
  34. # ...OR use the proxy repository to download the necessary dependencies, but this repo is not always updated
  35. #- git clone -b 1.10.x --depth=1 https://github.com/ywarnier/chamilo-vendors.git
  36. #- sudo mv chamilo-vendors/vendor .
  37. #- sudo mv chamilo-vendors/web .
  38. #- sudo mv chamilo-vendors/composer.lock .
  39. #- sudo rm -rf chamilo-vendors
  40. # Continue...
  41. - phpenv config-add tests/travis-php-config.ini
  42. # enable php-fpm
  43. - sudo /etc/init.d/php5-fpm stop
  44. - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
  45. - sudo a2enmod rewrite actions fastcgi alias
  46. - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  47. - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
  48. # configure apache virtual hosts
  49. - sudo cp -f tests/travis-apache /etc/apache2/sites-available/default
  50. - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
  51. - sudo service apache2 restart
  52. - sudo service php5-fpm restart
  53. - php5 -v
  54. # install Chash, a database, and then install Chamilo
  55. - git clone https://github.com/chamilo/chash
  56. - cd chash
  57. - composer install
  58. - composer update
  59. - php5 -d phar.readonly=0 createPhar.php
  60. - chmod +x chash.phar
  61. - sudo mv chash.phar /usr/local/bin/chash
  62. #- cd ..
  63. #- git clone -b nophpversioncheck --single-branch https://github.com/ywarnier/chamilo-cli-install.git
  64. #- cp chamilo-cli-install/chamilo-cli-installer.php main/install/
  65. #- mysql -u root -e 'create database chamilo'
  66. #- sudo chmod -R 0777 app/config app main/default_course_document/images main/lang
  67. #- cd main/install/
  68. #- 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'
  69. #- cd ../..
  70. # install Chamilo with Chash - see reference https://github.com/sonnym/travis-ci-drupal-module-example/blob/master/.travis.yml
  71. - cd /home/travis/build/chamilo/chamilo-lms
  72. # 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.
  73. # This effectively breaks the installer and renders these tests useless. We are looking for a solution (for example using containers)
  74. - sudo chash chash:chamilo_install --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="mysqlnd" --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" 1.10.x
  75. script:
  76. # - phpunit -c tests/phpunit
  77. # pwd shows /home/travis/build/chamilo/chamilo-lms
  78. - cd tests && ../vendor/behat/behat/bin/behat -v
  79. # configure notifications (email, IRC, campfire etc)
  80. notifications:
  81. # IRC notifications - disabled for creating a lot of noise on the channel
  82. irc: "irc.freenode.org#chamilodev"