This commit is contained in:
Nikola Kubiczek 2023-09-08 20:58:51 +02:00
parent 8dae52be4e
commit d9e9df2d67
Signed by: yaemiku
GPG Key ID: ADC039636B3E4AAB

View File

@ -6,13 +6,19 @@ stages:
before_script:
- if [ -n "$KUBE_CONTEXT" ]; then kubectl config use-context "$KUBE_CONTEXT"; fi
docker_build:
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:v1.14.0-debug
entrypoint: [""]
script:
- version=$(cat package.json | grep version | grep -Eo "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+")
- docker build -t registry.yaemiku.dev/yaemiku/hamburger -t registry.yaemiku.dev/yaemiku/hamburger:$(version) .
- docker login -u yaemiku -p $DOCKER_REGISTRY_PASSWORD registry.yaemiku.dev
- docker push -a registry.yaemiku.dev/yaemiku/hamburger
- cat $DOCKER_REGISTRY > /kaniko/.docker/config.json
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "registry.yaemiku.dev/yaemiku/hamburger:${CI_COMMIT_TAG}"
rules:
- if: $CI_COMMIT_TAG
deploy:
stage: deploy