---

.push:
  stage: image
  interruptible: true
  needs: []
  image:
    name: gcr.io/kaniko-project/executor:v1.9.0-debug
    entrypoint: [""]
  before_script:
    - mkdir -p /kaniko/.docker
    - echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"}}}" > /kaniko/.docker/config.json
  script:
    - |
      /kaniko/executor \
      --context . \
      --dockerfile "${DOCKERFILE}" \
      --destination "${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}/${CI_JOB_NAME}:${CI_COMMIT_SHA}" \
      --destination "${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}/${CI_JOB_NAME}:latest"
  only:
    - master

checker:
  extends:
    - .push
  variables:
    DOCKERFILE: Dockerfile-checker

receiver:
  extends:
    - .push
  variables:
    DOCKERFILE: Dockerfile-receiver

generator:
  extends:
    - .push
  variables:
    DOCKERFILE: Dockerfile-generator

admin:
  extends:
    - .push
  variables:
    DOCKERFILE: Dockerfile-admin

evdist:
  extends:
    - .push
  variables:
    DOCKERFILE: Dockerfile-evdist

frontend-ui:
  extends:
    - .push
  variables:
    DOCKERFILE: Dockerfile-frontend-ui

nginx:
  extends:
    - .push
  variables:
    DOCKERFILE: Dockerfile-nginx

dashboard:
  extends:
    - .push
  variables:
    DOCKERFILE: Dockerfile-dashboard

repochecker:
  extends:
    - .push
  variables:
    DOCKERFILE: Dockerfile-repochecker

qa:
  extends:
    - .push
  variables:
    DOCKERFILE: Dockerfile-qa
