.travis.yml 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. language: php
  2. php:
  3. - 5.4
  4. - 5.5
  5. - 5.6
  6. before_install:
  7. #- sudo apt-get install python-software-properties
  8. #- sudo add-apt-repository ppa:ondrej/php5 -y
  9. - sudo apt-get update -qq
  10. - sudo apt-get install -qq mysql-server
  11. - sudo apt-get install -qq apache2 libapache2-mod-fastcgi
  12. # Install additional PHP packages (check http://docs.travis-ci.com/user/ci-environment/#CI-environment-OS
  13. # for pre-installed packages)
  14. #- sudo apt-get install -qq php5-imagick
  15. # Following http://docs.travis-ci.com/user/languages/php/#PHP-installation,
  16. # php is compiled with --enable-fpm, so no install of FPM is needed.
  17. # However, not installing it generates errors with service php5-fpm restart
  18. # further down (need to use php-fpm without 5)
  19. - sudo apt-get install -qq php5-cli php5-fpm
  20. before_script:
  21. - php5 -v
  22. - php5 -m
  23. - composer self-update
  24. - composer global require "fxp/composer-asset-plugin:1.0.3"
  25. # You can either use the composer install method and face the Github limit
  26. #- composer install -n
  27. #- composer -v update
  28. # ...OR use the proxy repository to download the necessary dependencies
  29. - git clone -b 1.10.x --depth=1 https://github.com/ywarnier/chamilo-vendors.git
  30. - sudo mv chamilo-vendors/vendor .
  31. - sudo mv chamilo-vendors/web .
  32. - sudo mv chamilo-vendors/composer.lock .
  33. - sudo rm -rf chamilo-vendors
  34. # Continue...
  35. - phpenv config-add tests/travis-php-config.ini
  36. # enable php-fpm
  37. - sudo /etc/init.d/php-fpm stop
  38. - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
  39. - sudo a2enmod rewrite actions fastcgi alias
  40. - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  41. - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
  42. # configure apache virtual hosts
  43. - sudo cp -f tests/travis-apache /etc/apache2/sites-available/default
  44. - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
  45. - sudo service apache2 restart
  46. - sudo service php-fpm restart
  47. - php5 -v
  48. # install Chash, a database, and then install Chamilo
  49. - git clone https://github.com/chamilo/chash
  50. - cd chash
  51. - composer install
  52. - composer update
  53. - php5 -d phar.readonly=0 createPhar.php
  54. - chmod +x chash.phar
  55. - sudo mv chash.phar /usr/local/bin/chash
  56. #- cd ..
  57. #- git clone -b nophpversioncheck --single-branch https://github.com/ywarnier/chamilo-cli-install.git
  58. #- cp chamilo-cli-install/chamilo-cli-installer.php main/install/
  59. #- mysql -u root -e 'create database chamilo'
  60. #- sudo chmod -R 0777 app/config app main/default_course_document/images main/lang
  61. #- cd main/install/
  62. #- 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'
  63. #- cd ../..
  64. # install Chamilo with Chash - see reference https://github.com/sonnym/travis-ci-drupal-module-example/blob/master/.travis.yml
  65. - cd /home/travis/build/chamilo/chamilo-lms
  66. - 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
  67. script:
  68. # - phpunit -c tests/phpunit
  69. # pwd shows /home/travis/build/chamilo/chamilo-lms
  70. - cd tests && ../vendor/behat/behat/bin/behat -v
  71. # configure notifications (email, IRC, campfire etc)
  72. notifications:
  73. # IRC notifications - disabled for creating a lot of noise on the channel
  74. irc: "irc.freenode.org#chamilodev"