-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
25 lines (24 loc) · 967 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
stages:
- build
build:
stage: build
only:
- tags
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- |
# Determine if the tag is a release version (0.0.0 / v0.0.0) or a pre-release (0.0.0-dev / v0.0.0-dev)
if [[ "$CI_COMMIT_TAG" =~ ^[vV]*[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
# Push both the specific version tag and the latest tag for release versions
/kaniko/executor --context "${CI_PROJECT_DIR}" \
--dockerfile "${CI_PROJECT_DIR}/Dockerfile" \
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}" \
--destination "${CI_REGISTRY_IMAGE}:latest"
else
# Push only the specific version tag for pre-release versions
/kaniko/executor --context "${CI_PROJECT_DIR}" \
--dockerfile "${CI_PROJECT_DIR}/Dockerfile" \
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
fi