.travis.yml 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. language: php
  2. php:
  3. #- 5.4 // Removed because of Chash dependencies on PHP 5.5
  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. # Previously, fxp/composer-asset-plugin was required but was causing a lot of trouble updating. Now it's disabled.
  25. #- composer global require "fxp/composer-asset-plugin:1.0.3"
  26. # You can either use the composer install method and face the Github limit
  27. #- composer install -n
  28. - composer -v update
  29. # ...OR use the proxy repository to download the necessary dependencies
  30. #- git clone -b 1.10.x --depth=1 https://github.com/ywarnier/chamilo-vendors.git
  31. #- sudo mv chamilo-vendors/vendor .
  32. #- sudo mv chamilo-vendors/web .
  33. #- sudo mv chamilo-vendors/composer.lock .
  34. #- sudo rm -rf chamilo-vendors
  35. # Continue...
  36. - phpenv config-add tests/travis-php-config.ini
  37. # enable php-fpm
  38. - sudo /etc/init.d/php5-fpm stop
  39. - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
  40. - sudo a2enmod rewrite actions fastcgi alias
  41. - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  42. - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
  43. # configure apache virtual hosts
  44. - sudo cp -f tests/travis-apache /etc/apache2/sites-available/default
  45. - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
  46. - sudo service apache2 restart
  47. - sudo service php5-fpm restart
  48. - php5 -v
  49. # install Chash, a database, and then install Chamilo
  50. - git clone https://github.com/chamilo/chash
  51. - cd chash
  52. - composer install
  53. - composer update
  54. - php5 -d phar.readonly=0 createPhar.php
  55. - chmod +x chash.phar
  56. - sudo mv chash.phar /usr/local/bin/chash
  57. #- cd ..
  58. #- git clone -b nophpversioncheck --single-branch https://github.com/ywarnier/chamilo-cli-install.git
  59. #- cp chamilo-cli-install/chamilo-cli-installer.php main/install/
  60. #- mysql -u root -e 'create database chamilo'
  61. #- sudo chmod -R 0777 app/config app main/default_course_document/images main/lang
  62. #- cd main/install/
  63. #- 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'
  64. #- cd ../..
  65. # install Chamilo with Chash - see reference https://github.com/sonnym/travis-ci-drupal-module-example/blob/master/.travis.yml
  66. - cd /home/travis/build/chamilo/chamilo-lms
  67. - 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
  68. script:
  69. # - phpunit -c tests/phpunit
  70. # pwd shows /home/travis/build/chamilo/chamilo-lms
  71. - cd tests && ../vendor/behat/behat/bin/behat -v
  72. # configure notifications (email, IRC, campfire etc)
  73. notifications:
  74. # IRC notifications - disabled for creating a lot of noise on the channel
  75. irc: "irc.freenode.org#chamilodev"