add prepare release job

This commit is contained in:
2024-05-16 00:21:31 +03:00
parent 815e16324c
commit 7e510a487f

View File

@@ -12,6 +12,13 @@ variables:
value: "No" value: "No"
description: Create release from this build? description: Create release from this build?
WITHOUT_BUILD:
options:
- "No"
- "Yes"
value: "Yes"
description: Create release without building?
stages: stages:
- build - build
- release - release
@@ -24,7 +31,7 @@ build-docker:
image: image:
name: ${KANIKO_IMAGE} name: ${KANIKO_IMAGE}
entrypoint: [""] entrypoint: [""]
allow_failure: true allow_failure: false
tags: tags:
- build - build
- docker - docker
@@ -39,6 +46,8 @@ build-docker:
--destination "${DOCKER_IMAGE}:${VERSION}-${CI_COMMIT_SHORT_SHA}" --destination "${DOCKER_IMAGE}:${VERSION}-${CI_COMMIT_SHORT_SHA}"
dependencies: [] dependencies: []
rules: rules:
- if: $PREPARE_RELEASE == "Yes" && $WITHOUT_BUILD == "Yes"
when: never
- changes: - changes:
- build/docker/**/* - build/docker/**/*
- cmd/**/* - cmd/**/*
@@ -64,7 +73,7 @@ make-release:
- echo "Preparing release for version ${VERSION}-${CI_COMMIT_SHORT_SHA}" - echo "Preparing release for version ${VERSION}-${CI_COMMIT_SHORT_SHA}"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
name: kube-forge:${VERSION}-${CI_COMMIT_SHORT_SHA} name: kube-forge:${VERSION}-${CI_COMMIT_SHORT_SHA}
tag_name: "${VERSION}-${CI_COMMIT_SHORT_SHA}" tag_name: "${CI_COMMIT_SHORT_SHA}"
description: "${VERSION}-${CI_COMMIT_SHORT_SHA}" description: "${VERSION}-${CI_COMMIT_SHORT_SHA}"
assets: assets:
links: links: