sudo: required
dist: trusty

before_install:
  - sudo rm -rf ~/.gnupg
  - sudo integration-scripts/install_repositories.sh
  # TravisCI installs MySQL 5.6 on trusty containers by default, but
  # the 'mysql-server' (and any analogous) Ubuntu package installs
  # version 5.5. To prevent breakage with our default installation
  # scripts, we downgrade MySQL to version 5.5.
  # For more information, see here: https://docs.travis-ci.com/user/build-environment-updates/2015-04-09/#Downgrading-MySQL-to-5.5.41
  - sudo rm -f /etc/apt/sources.list.d/mysql.list
  - sudo service mysql stop
  - sudo rm -rf /var/lib/mysql
  - sudo apt-get remove apparmor
  - sudo apt-get remove --purge mysql-common mysql-client libmysqlclient18 libmysqlclient-dev mysql-server
  - sudo apt-get remove --purge '^mysql*' 'libmysql*'
  - sudo apt-get autoremove
  - sudo apt-get autoclean
  - sudo apt-get install mysql-client-5.5 mysql-server-5.5
  - mysql -u root -e "CREATE USER 'travis'@'%' IDENTIFIED BY ''"
  - mysql -u root -e "CREATE USER 'travis'@'localhost' IDENTIFIED BY ''"
  - mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'travis'@'%'"
  - mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'travis'@'localhost'"
install:
  - sudo integration-scripts/install_common.sh
  - travis_wait 40 sudo integration-scripts/install_codeface_R.sh
  - sudo integration-scripts/install_codeface_python.sh
  - sudo integration-scripts/install_cppstats.sh
  - sudo integration-scripts/setup_database.sh
  - integration-scripts/install_codeface_node.sh
script:
  - integration-scripts/test_codeface.sh
