.gitlab-ci.yml 764 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
image:
  name: gcr.io/kaniko-project/executor:debug
  entrypoint: [""]

stages:
  - build
  - deploy

build:
  stage: build
  only:
    - master
  script:
    - mkdir -p /kaniko/.docker
Sander Kuusemets's avatar
Sander Kuusemets committed
15
16
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}, \"$REMOTE_REGISTRY_ADDRESS\":{\"username\":\"$REMOTE_REGISTRY_USER\",\"password\":\"$REMOTE_REGISTRY_TOKEN\"}}}" > /kaniko/.docker/config.json
    - /kaniko/executor --context $CI_PROJECT_DIR --cache --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_BUILD_REF --destination $CI_REGISTRY_IMAGE:latest --destination $REMOTE_REGISTRY_ADDRESS/$CI_PROJECT_PATH:$CI_BUILD_REF --destination $REMOTE_REGISTRY_ADDRESS/$CI_PROJECT_PATH:latest