.travis.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. dist: bionic
  2. sudo: required
  3. language: php
  4. addons:
  5. apt:
  6. packages:
  7. - apache2
  8. - postfix
  9. - libappindicator1
  10. - fonts-liberation
  11. services:
  12. - mysql
  13. - xvfb
  14. cache:
  15. yarn: true
  16. directories:
  17. - $HOME/.composer/cache/files
  18. php:
  19. - 7.2
  20. - 7.3
  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. - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
  30. # Get Chrome driver
  31. - wget https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip && unzip chromedriver_linux64.zip
  32. - sudo mv chromedriver /usr/bin
  33. - sudo chmod +x /usr/bin/chromedriver
  34. # Get Selenium
  35. - wget http://selenium-release.storage.googleapis.com/3.1/selenium-server-standalone-3.1.0.jar
  36. # Check java
  37. - java -version
  38. - java -jar selenium-server-standalone-3.1.0.jar -log selenium.log > /dev/null &
  39. - nohup bash -c "webdriver-manager start 2>&1 &"
  40. - sleep 10
  41. # Apache & php-fpm configuration
  42. - bash tests/travis/setup-php-fpm.sh
  43. - bash tests/travis/setup-apache.sh
  44. - curl $VHOST_URL
  45. - mysqld --version
  46. - apache2 -v
  47. - php -v
  48. - php -ini | grep memory_limit
  49. - sudo cat /etc/hosts
  50. # Install Chash, a database, and then install Chamilo
  51. - git clone https://github.com/chamilo/chash
  52. - cd chash
  53. - git log -1 # check chash version
  54. - composer install
  55. - php -d phar.readonly=0 createPhar.php
  56. - chmod +x chash.phar
  57. - sudo mv chash.phar /usr/local/bin/chash
  58. # Download chamilo
  59. - php -d date.timezone="Europe/Paris" chash.php chash:chamilo_install $CHAMILO_VERSION $TRAVIS_BUILD_DIR --download-package --no-interaction --only-download-package
  60. - cd $TRAVIS_BUILD_DIR
  61. - pwd
  62. # Install vendors
  63. - travis_wait 45 composer install
  64. # Install chamilo
  65. - 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"
  66. # Install bundle js/css
  67. - php bin/console assets:install
  68. # Permissions
  69. - sudo chmod -R 777 var/cache var/log var/courses var/upload public
  70. # Dump js routes
  71. - php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
  72. - # Install third party js/css libraries
  73. - yarn install
  74. - ./node_modules/.bin/encore dev
  75. # Check chamilo status
  76. - php -d date.timezone="Europe/Paris" $TRAVIS_BUILD_DIR/chash/chash.php chash:chamilo_status
  77. # Permissions
  78. - sudo chown -R www-data:www-data $TRAVIS_BUILD_DIR
  79. - sudo chown -R 775 $TRAVIS_BUILD_DIR
  80. - sudo chmod +x /home/travis/build
  81. - sudo service apache2 restart
  82. - curl $VHOST_URL
  83. - curl $VHOST_URL/public
  84. - curl $VHOST_URL/public/login
  85. - ls -la public/build
  86. script:
  87. - whereis google-chrome-stable
  88. - google-chrome-stable --version
  89. - whereis chromedriver
  90. - chromedriver --version
  91. - cd tests/behat
  92. - pwd
  93. - travis_wait 45 ../../vendor/behat/behat/bin/behat -v
  94. # - sudo cat /var/log/apache2/$VHOST_URL-access.log
  95. after_failure:
  96. - sudo apache2ctl -M
  97. - sudo cat /var/log/apache2/error.log
  98. # configure notifications (email, IRC, campfire etc)
  99. notifications:
  100. slack:
  101. rooms:
  102. secure: wlaaOwNt58ENjx2PEciISr4VBRWXp6YfI8TAZgvhDO1H0XpLByRYyktgm/+h6NQWvTEcPGBSFcsIA6K0N8FA52/fdDQFxbe0en+b4q7AGNLdjTRdszfZ4AbIdRngSBFKRmXC5IX0dEx/nGWYp5fRs26QPvgBadpj8M11BnL7qhg=