.travis.yml 4.0 KB

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