dist: trusty

sudo: required

language: cpp

services:
  - docker

env:
  matrix:
    - TYPE=normal OS=ubuntu OS_VER=18.04 PUSH_IMAGE=1
    - TYPE=normal OS=fedora OS_VER=28 PUSH_IMAGE=1 AUTO_DOC_UPDATE=1
    - TYPE=normal OS=ubuntu OS_VER=18.04 COVERAGE=1
    - TYPE=coverity OS=ubuntu OS_VER=18.04

before_install:
  - echo $TRAVIS_COMMIT_RANGE
  - export HOST_WORKDIR=`pwd`
  - export GITHUB_REPO=pmem/libpmemobj-cpp
  - export DOCKERHUB_REPO=pmem/libpmemobj-cpp
  - cd utils/docker
  - ./pull-or-rebuild-image.sh
  - if [[ -f push_image_to_repo_flag ]]; then PUSH_THE_IMAGE=1; fi
  - if [[ -f skip_build_package_check ]]; then export SKIP_CHECK=1; fi
  - rm -f push_image_to_repo_flag skip_build_package_check

script:
  - ./build.sh

after_success:
  - if [[ $PUSH_THE_IMAGE -eq 1 ]]; then images/push-image.sh $OS-$OS_VER; fi
