sudo: required
dist: xenial
services:
    - docker

env:
    global:
        - CI_ROOT="$TRAVIS_BUILD_DIR/ci/"

jobs:
    include:
        - name: CentOS 8
          language: bash
          env:
              - CENTOS_RELEASE="centos8"
              - CONT_NAME="systemd-centos-$CENTOS_RELEASE"
              - DOCKER_EXEC="docker exec -ti $CONT_NAME"
          before_install:
              - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
              - docker --version
          install:
              - $CI_ROOT/travis-centos-rhel8.sh SETUP
          script:
              - set -e
              # Build systemd
              - $CI_ROOT/travis-centos-rhel8.sh RUN
              - set +e
          after_script:
              - $CI_ROOT/travis-centos-rhel8.sh CLEANUP

        - name: CentOS 8 (ASan+UBSan)
          language: bash
          env:
              - CENTOS_RELEASE="centos8"
              - CONT_NAME="systemd-centos-$CENTOS_RELEASE"
              - DOCKER_EXEC="docker exec -ti $CONT_NAME"
          before_install:
              - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
              - docker --version
          install:
              - $CI_ROOT/travis-centos-rhel8.sh SETUP
          script:
              - set -e
              # Build systemd
              - $CI_ROOT/travis-centos-rhel8.sh RUN_ASAN
              - set +e
          after_script:
              - $CI_ROOT/travis-centos-rhel8.sh CLEANUP
