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