sudo: required
language: generic
dist: trusty
env:
  - COVERAGE_FILE=/tmp/.coverage
after_success:
  - codecov
script:
  - sudo apt install software-properties-common python3-setuptools python3-mysql.connector python3-pyxattr
  - sudo mkdir -p /etc/systemd/system # Until Travis is stuck with 14.04
  - sudo easy_install3 pip
  - sudo -H pip3 install -r requirements.txt
  - sudo -H pip3 install codecov pytest-cov requests-kerberos
  - sudo -H pip3 install -e .
  - echo ca | sudo tee /etc/hostname
  - echo 127.0.0.1 localhost | sudo tee /etc/hosts
  - echo 127.0.1.1 ca.example.lan ca | sudo tee -a /etc/hosts
  - sudo hostname -F /etc/hostname
  - sudo find /home/ -type d -exec chmod 755 {} \; # Allow certidude serve to read templates
  - sudo coverage run --parallel-mode --source certidude -m py.test tests
  - sudo coverage combine
  - sudo coverage report
  - sudo coverage xml -i
cache: pip

sudo: required
language: generic
dist: trusty
env:
  - COVERAGE_FILE=/tmp/.coverage
after_success:
  - codecov
script:
  - sudo npm config set registry=http://registry.npmjs.org/
  - sudo apt install software-properties-common python3-setuptools python3-mysql.connector python3-pyxattr
  - sudo mkdir -p /etc/systemd/system # Until Travis is stuck with 14.04
  - sudo easy_install3 pip
  - sudo -H pip3 install -r requirements.txt
  - sudo -H pip3 install codecov pytest-cov requests-kerberos
  - sudo -H pip3 install -e .
  - echo ca | sudo tee /etc/hostname
  - echo 127.0.0.1 localhost | sudo tee /etc/hosts
  - echo 127.0.1.1 ca.example.lan ca | sudo tee -a /etc/hosts
  - sudo hostname -F /etc/hostname
  - sudo find /home/ -type d -exec chmod 755 {} \; # Allow certidude serve to read templates
  - sudo coverage run --parallel-mode --source certidude -m py.test tests
  - sudo coverage combine
  - sudo coverage report
  - sudo coverage xml -i
cache: pip

Disable NPM's HTTP for Travis, due to old ca-certificates package
tests: Disable NPM's HTTP for Travis, due to old ca-certificates package
