.travis.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. language: php
  2. addons:
  3. apt:
  4. packages:
  5. - apache2
  6. - postfix
  7. - libapache2-mod-fastcgi
  8. - libappindicator1
  9. - fonts-liberation
  10. services:
  11. - mysql
  12. sudo: required
  13. dist: trusty
  14. cache:
  15. directories:
  16. - $HOME/.composer/cache/files
  17. php:
  18. #- 5.4 // Removed because of Chash dependencies on PHP 5.5
  19. - 5.5
  20. - 5.6
  21. - 7.0
  22. env:
  23. global:
  24. - VHOST_URL=localhost
  25. - CHAMILO_VERSION=1.11.x
  26. before_install:
  27. # Get Chrome
  28. - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
  29. - sudo apt-get update
  30. - sudo apt-get install google-chrome-stable
  31. # Get Chrome driver
  32. - wget https://chromedriver.storage.googleapis.com/2.27/chromedriver_linux64.zip && unzip chromedriver_linux64.zip && sudo mv chromedriver /usr/bin
  33. # Setup display for Selenium
  34. - sh -e /etc/init.d/xvfb start
  35. - export DISPLAY=:99.0
  36. # Get Selenium
  37. - wget http://selenium-release.storage.googleapis.com/3.1/selenium-server-standalone-3.1.0.jar
  38. # Check java
  39. - java -version
  40. - sudo apt-get install oracle-java8-installer
  41. - java -version
  42. - java -jar selenium-server-standalone-3.1.0.jar -log selenium.log > /dev/null &
  43. - nohup bash -c "webdriver-manager start 2>&1 &"
  44. - sleep 10
  45. # Apache & php-fpm configuration
  46. - bash tests/travis/setup-php-fpm.sh
  47. - bash tests/travis/setup-apache.sh
  48. - mysqld --version
  49. - apache2 -v
  50. - php -v
  51. - sudo cat /etc/hosts
  52. - phpenv config-add tests/travis/php-config.ini
  53. # Install Chash, a database, and then install Chamilo
  54. - git clone https://github.com/chamilo/chash
  55. - cd chash
  56. - composer update
  57. - php -d phar.readonly=0 createPhar.php
  58. - chmod +x chash.phar
  59. - sudo mv chash.phar /usr/local/bin/chash
  60. # Download chamilo
  61. - php -d date.timezone="Europe/Paris" chash.php chash:chamilo_install $CHAMILO_VERSION $TRAVIS_BUILD_DIR --download-package --no-interaction --only-download-package
  62. - cd $TRAVIS_BUILD_DIR
  63. - pwd
  64. # Install vendors
  65. - composer update
  66. # Install chamilo
  67. - php -d date.timezone="Europe/Paris" $TRAVIS_BUILD_DIR/chash/chash.php chash:chamilo_install $CHAMILO_VERSION $TRAVIS_BUILD_DIR --no-interaction --sitename="Chamilo" --site_url="http://$VHOST_URL/" --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"
  68. - sudo chmod -R 777 app/cache app/logs app/courses app/upload
  69. # Check chamilo status
  70. - php -d date.timezone="Europe/Paris" $TRAVIS_BUILD_DIR/chash/chash.php chash:chamilo_status
  71. - ls -la
  72. - ls -la /var/www
  73. # Permissions
  74. - sudo chown -R www-data:www-data $TRAVIS_BUILD_DIR
  75. - sudo chown -R 775 $TRAVIS_BUILD_DIR
  76. - sudo chmod +x /home/travis/build
  77. - sudo service apache2 restart
  78. - curl $VHOST_URL
  79. script:
  80. - cd tests/behat
  81. - travis_wait 45 ../../vendor/behat/behat/bin/behat -v
  82. #- sudo cat /var/log/apache2/$VHOST_URL-error.log
  83. #- sudo cat /var/log/apache2/$VHOST_URL-access.log
  84. # configure notifications (email, IRC, campfire etc)
  85. notifications:
  86. # IRC notifications - disabled for creating a lot of noise on the channel
  87. irc: "irc.freenode.org#chamilodev"