Commit b8fdb99a authored by Igor's avatar Igor 🔥

Use kaniko

parent 448adf34
Pipeline #1301 passed with stages
in 1 minute and 43 seconds
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
COMPOSER_HOME: .composer
JEKYLL_ENV: production
services:
- docker:dind
stages:
- build
......@@ -17,21 +11,22 @@ stages:
before_script:
- which docker && docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" || true
build-image:
.kaniko_template: &kaniko_template
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
build image:
stage: build
tags:
- dind
<<: *kaniko_template
script:
- docker build --pull -t "$TEST_IMAGE" .
- docker push "$TEST_IMAGE"
- executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $TEST_IMAGE
release-image:
release image:
stage: release
tags:
- dind
<<: *kaniko_template
script:
- docker pull "$TEST_IMAGE"
- docker tag "$TEST_IMAGE" "$RELEASE_IMAGE"
- docker push "$RELEASE_IMAGE"
only:
- master
- echo -e "FROM $TEST_IMAGE" | executor --dockerfile /dev/stdin --destination $RELEASE_IMAGE
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