Verified Commit 8b2bba18 authored by Robotka Adrián's avatar Robotka Adrián
Browse files

templating .gitlab-ci.yml

parent b4b5b628
Pipeline #4596 passed with stage
in 40 seconds
......@@ -2,20 +2,30 @@ stages:
- build
before_script:
- echo "{\"auths\":{\"registry.kszk.bme.hu\":{\"username\":\"$CI_REG_USER\",\"password\":\"$CI_REG_PASS\"}}}" > /kaniko/.docker/config.json
# auth docker registry before using it
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$KSZK_NEXUS_USERNAME\",\"password\":\"$KSZK_NEXUS_PASSWORD\"}}}"
> /kaniko/.docker/config.json
kubectl build:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/kubectl/Dockerfile --destination "registry.kszk.bme.hu/baseimg/kubectl"
###################### Image builder template #####################
python tools build:
# hidden job, not gonna run, just for the inheritance
.image-template:
stage: build
variables:
IMAGE_NAME: $CI_JOB_NAME
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/python-tools/Dockerfile --destination "registry.kszk.bme.hu/baseimg/python-tools"
- /kaniko/executor
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/$IMAGE_NAME/Dockerfile
--destination "$CI_REGISTRY_IMAGE/$IMAGE_NAME"
############################ Real work ############################
kubectl: # Nomen est omen
extends: .image-template
python-tools: # Nomen est omen
extends: .image-template
Supports Markdown
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