image: eu.gcr.io/jetstack-build-infra-images/bazelbuild:v20181107-8aac55d-0.18.0

variables:
  DOCKER_DRIVER: overlay

services:
- docker:1.12-dind

before_script:
- curl -L "https://get.docker.com/builds/Linux/x86_64/docker-1.9.1.tgz" | tar -C /usr/bin -xvzf- --strip-components=3 usr/local/bin/docker
- export DOCKER_HOST=${DOCKER_PORT}
- docker info > /dev/null

build:
  tags:
  - docker
  script:
  - make verify images
  except:
  - master
  - tags

master_push:
  tags:
  - docker
  script:
  - mkdir -p ~/.docker && echo "${DOCKER_AUTH_CONFIG}" > ~/.docker/config.json && chmod 600 ~/.docker/config.json
  - make verify
  - APP_VERSION=${CI_BUILD_REF_SLUG}-${CI_PIPELINE_ID} make images_push
  - APP_VERSION=canary make images_push
  only:
  - master

release_push:
  tags:
  - docker
  script:
  - mkdir -p ~/.docker && echo "${DOCKER_AUTH_CONFIG}" > ~/.docker/config.json && chmod 600 ~/.docker/config.json
  - make verify
  - APP_VERSION=${CI_COMMIT_TAG} make images_push DOCKER_TAG="${CI_COMMIT_TAG}"
  only:
  - tags

image: eu.gcr.io/jetstack-build-infra-images/bazelbuild:v20181107-8aac55d-0.18.0

variables:
  DOCKER_DRIVER: overlay

services:
- docker:1.12-dind

before_script:
- curl -L "https://get.docker.com/builds/Linux/x86_64/docker-1.9.1.tgz" | tar -C /usr/bin -xvzf- --strip-components=3 usr/local/bin/docker
- export DOCKER_HOST=${DOCKER_PORT}
- docker info > /dev/null

build:
  tags:
  - docker
  script:
  - make verify images
  except:
  - master
  - tags

master_push:
  tags:
  - docker
  script:
  - mkdir -p ~/.docker && echo "${DOCKER_AUTH_CONFIG}" > ~/.docker/config.json && chmod 600 ~/.docker/config.json
  - make verify
  - make images_push APP_VERSION="${CI_BUILD_REF_SLUG}-${CI_PIPELINE_ID}"
  - make images_push APP_VERSION="canary"
  only:
  - master

release_push:
  tags:
  - docker
  script:
  - mkdir -p ~/.docker && echo "${DOCKER_AUTH_CONFIG}" > ~/.docker/config.json && chmod 600 ~/.docker/config.json
  - make verify
  - make images_push APP_VERSION="${CI_COMMIT_TAG}"
  only:
  - tags

Fix GitLab build use of APP_VERSION
Fix GitLab build use of APP_VERSION

Signed-off-by: James Munnelly <474ba67bdb289c6263b36dfd8a7bed6c85b04943@munnelly.eu>
