Skip to content
Snippets Groups Projects

Добавлен конвейер выпуска релиза для perxis-proto

1 file
+ 2
0
Compare changes
  • Side-by-side
  • Inline
.gitlab-ci.yml 0 → 100644
+ 78
0
stages:
- release
# Инициация процесса релиза. Запускается вручную или из восходящего конвейера
start_release:
image: alpine:latest
stage: release
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
- if: $CI_PIPELINE_SOURCE == "web"
when: manual
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
before_script:
- apk --no-cache add git
script:
- echo "Start release for perxis-proto"
- echo LAST_VERSION=$(git describe --tags --abbrev=0) >> vars.env
artifacts:
reports:
dotenv: vars.env
# Расчет новой версии и формирование Changelog
get_release_info:
stage: release
image:
name: orhunp/git-cliff:latest
entrypoint: [ "" ]
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
- if: $CI_PIPELINE_SOURCE == "web"
needs:
- job: start_release
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
script:
- echo "VERSION=$(git-cliff --bumped-version)" >> vars.env
- echo "$(git-cliff --unreleased | sed '1,6d' | sed '$d')" > CHANGELOG.md
artifacts:
reports:
dotenv: vars.env
paths:
- CHANGELOG.md
# Выпуск релиза и публикация артефактов с новой версией и списком изменений
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
- if: $CI_PIPELINE_SOURCE == "web"
needs:
- job: start_release
artifacts: true
- job: get_release_info
artifacts: true
script:
- echo "PERXIS_PROTO_RELEASE_VERSION=$VERSION" >> vars.env
- |
if [ "$VERSION" == "$LAST_VERSION" ]; then
exit 204
fi
# # TODO Убрать при влитии feature-ветки в мастер
# release:
# name: "Release $VERSION"
# tag_name: "$VERSION"
# description: "$VERSION"
allow_failure:
exit_codes:
- 204
artifacts:
when: always
paths:
- vars.env
- CHANGELOG.md
expire_in: 1 week
\ No newline at end of file
Loading