.travis.yml 4.1 KB

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