Commit 7bba3a43 authored by Jonas Waeber's avatar Jonas Waeber

Add Kaniko to CI process.

parent 16a4bd1a
Pipeline #17359 failed with stage
in 4 minutes and 8 seconds
...@@ -13,52 +13,20 @@ test: ...@@ -13,52 +13,20 @@ test:
script: script:
- gradle --no-daemon --no-scan --no-build-cache test --fail-fast - gradle --no-daemon --no-scan --no-build-cache test --fail-fast
build:
.build-image:
stage: publish stage: publish
image: docker:stable tags:
services: - mbr
- docker:dind image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script: script:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASSWORD" "$REGISTRY" - mkdir -p /kaniko/.docker
- docker build --pull -t "$IMAGE_TAG" -f "$DOCKERFILE" . - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- docker push "$IMAGE_TAG" - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
- docker logout
build-tagged-image:
extends: .build-image
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
REGISTRY_PASSWORD: "$CI_REGISTRY_PASSWORD"
REGISTRY_USER: "$CI_REGISTRY_USER"
REGISTRY: "$CI_REGISTRY"
DOCKERFILE: "Dockerfile"
only: only:
- tags - tags
build-latest-image:
extends: .build-image
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:latest"
REGISTRY_PASSWORD: "$CI_REGISTRY_PASSWORD"
REGISTRY_USER: "$CI_REGISTRY_USER"
REGISTRY: "$CI_REGISTRY"
DOCKERFILE: "Dockerfile"
only:
- master
build-feature-branch-image:
extends: .build-image
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
REGISTRY_PASSWORD: "$CI_REGISTRY_PASSWORD"
REGISTRY_USER: "$CI_REGISTRY_USER"
REGISTRY: "$CI_REGISTRY"
DOCKERFILE: "Dockerfile"
except:
- master
- tags
test-chart: test-chart:
stage: test stage: test
image: dtzar/helm-kubectl:3.2.0 image: dtzar/helm-kubectl:3.2.0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment