feat(ci): split develop and release build

This commit is contained in:
Nya Candy 2023-01-29 00:38:52 +08:00
parent 33faca4245
commit 6aa0db6d0e
No known key found for this signature in database
GPG Key ID: 8B1BE5E86F2E66AE
1 changed files with 19 additions and 2 deletions

View File

@ -7,7 +7,22 @@ sast:
stages:
- build
build-job:
build-develop:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- >-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:develop"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}"
build-release:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
@ -20,4 +35,6 @@ build-job:
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:latest"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
rules:
- if: $CI_COMMIT_TAG