.travis.yml 4.1 KB

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