dist: trusty

language: go

go: 1.8

go_import_path: github.com/jetstack/navigator

services:
- docker

jobs:
  include:
    - stage: test
      env:
      - KUBERNETES_VERSION=v1.8.0
      before_script:
      - ./hack/install-e2e-dependencies.sh
      script:
      - make BUILD_TAG=latest build e2e-test

    - stage: test
      env:
      - KUBERNETES_VERSION=v1.7.0
      before_script:
      - ./hack/install-e2e-dependencies.sh
      script:
      - make BUILD_TAG=latest build e2e-test

    - stage: test
      script:
      - make verify

    - stage: build
      script:
      - make go_build docker_build
      - if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ]; then
          mkdir -p ~/.docker && echo "${DOCKER_AUTH_CONFIG}" > ~/.docker/config.json && chmod 600 ~/.docker/config.json;
          make docker_push IMAGE_TAGS="${TRAVIS_COMMIT} latest";
        fi

# Only run tests when master branch changes or when a PR branch is updated.
branches:
  only:
  - master

dist: trusty

language: go

go: 1.8

go_import_path: github.com/jetstack/navigator

services:
- docker

jobs:
  include:
    - stage: test
      env:
      - KUBERNETES_VERSION=v1.8.0
      before_script:
      - ./hack/install-e2e-dependencies.sh
      script:
      - make BUILD_TAG=latest build e2e-test

    - stage: test
      env:
      - KUBERNETES_VERSION=v1.7.0
      before_script:
      - ./hack/install-e2e-dependencies.sh
      script:
      - make BUILD_TAG=latest build e2e-test

    - stage: test
      script:
      - make verify

    - stage: build
      script:
      - make go_build docker_build
      - if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ]; then
          mkdir -p ~/.docker && echo "${DOCKER_AUTH_CONFIG}" > ~/.docker/config.json && chmod 600 ~/.docker/config.json;
          make docker_push IMAGE_TAGS="${TRAVIS_COMMIT} latest";
        fi

Revert "Only run Travis-CI tests for PRs and when master branch changes"
Revert "Only run Travis-CI tests for PRs and when master branch changes"
