Skip to content
Snippets Groups Projects
Verified Commit d158b38f authored by Varac's avatar Varac
Browse files

Use kaniko build template

parent 86be9e3a
Branches
Tags
No related merge requests found
include:
- .gitlab/ci_templates/kaniko.yml
stages:
- build
- setup-cluster
......@@ -9,20 +12,15 @@ stages:
image: "${CI_REGISTRY_IMAGE}/openappstack-ci:${CI_COMMIT_REF_NAME}"
ci_test_image:
stage: build
image:
# We need a shell to provide the registry credentials, so we need to use the
# kaniko debug image (https://github.com/GoogleContainerTools/kaniko#debug-image)
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context ${CI_PROJECT_DIR}/test --dockerfile ${CI_PROJECT_DIR}/test/Dockerfile --destination $CI_REGISTRY_IMAGE/openappstack-ci:${CI_COMMIT_REF_NAME}
variables:
KANIKO_CONTEXT: "test"
KANIKO_IMAGENAME: "openappstack-ci"
only:
changes:
- .gitlab-ci.yml
- test/Dockerfile
- test/requirements.txt
extends: .kaniko_build
bootstrap:
stage: setup-cluster
......
# Optional environment variables:
# - KANIKO_IMAGENAME
# - KANIKO_CONTEXT: The subdir which holds the Dockerfile, leave unset if
# the Dockerfile is located at root level of the project.
.kaniko_build:
stage: build
image:
# We need a shell to provide the registry credentials, so we need to use the
# kaniko debug image (https://github.com/GoogleContainerTools/kaniko#debug-image)
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "CI_REGISTRY: $CI_REGISTRY"
- echo "CI_REGISTRY_USER: $CI_REGISTRY_USER"
- echo "KANIKO_CONTEXT: $KANIKO_CONTEXT"
- echo "KANIKO_IMAGENAME: $KANIKO_IMAGENAME"
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context ${CI_PROJECT_DIR}/${KANIKO_CONTEXT:-.} --dockerfile ${CI_PROJECT_DIR}/${KANIKO_CONTEXT:-.}/Dockerfile --destination $CI_REGISTRY_IMAGE/${KANIKO_IMAGENAME/#//}:${CI_COMMIT_REF_NAME}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment