FAQ | This is a LIVE service | Changelog

Skip to content
Commits on Source (2)
  • Dr Rich Wareham's avatar
    feat(release-it): tweak template to be common pipeline amenable · beeb2e01
    Dr Rich Wareham authored
    As noted in #94, release-it was not yet present in the common pipeline
    which was a blocker of the vision of "OpenAPI client generation releases
    are zero-configuration". #94 also noted that not much had to be done to
    add release-it to the common pipeline.
    
    Gate the release-it jobs behind the presence of a `.release-it.json`
    file in the root of the repository. This should have zero effect on
    current users since that file needs to be present in order to use
    release-it. Guard against inadvertent triggering by allowing jobs to be
    explicitly disabled via a `RELEASE_IT_DISABLED` variable.
    
    To guard against future namespace clashes, namespace all the release-it
    jobs. In #94, it was originally suggested that the
    `USE_MERGE_REQUEST_RELEASE_FLOW` variable could be namespaces and given
    the backup value of `USE_MERGE_REQUEST_RELEASE_FLOW` to avoid breaking
    clients but, upon reflection, having *two* variables controlling this
    behaviour adds more confusion than it prevents. As such, leave the
    variable un-namespaced as an interesting historical remnant.
    beeb2e01
  • Dr Rich Wareham's avatar
    Merge branch 'issue-94-add-release-it-to-common-pipeline' into 'master' · 7ce4cade
    Dr Rich Wareham authored
    feat(release-it): tweak template to be common pipeline amenable
    
    Closes #94
    
    See merge request !109
    7ce4cade
......@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [6.4.0] - 2024-12-05
### Changed
- The release-it template is now added to the common pipeline and is gated on
there being a `.release-it.json` file present in the repository root. This
shouldn't affect any current users since this file needs to be present to use
release-it.
## [6.3.0] - 2024-12-05
### Added
......
......@@ -20,6 +20,7 @@ include:
- local: "/auto-devops/mkdocs-docs.gitlab-ci.yml"
- local: "/auto-devops/trigger-renovatebot.gitlab-ci.yml"
- local: "/auto-devops/openapi-generator.gitlab-ci.yml"
- local: "/auto-devops/release-it.yml"
# Fail-safe workflow rules. These can be overridden by CI configuration which includes us.
- template: Workflows/Branch-Pipelines.gitlab-ci.yml
......
# release-it.yml enables automated release management using the release-it tool.
#
# This template is intended to be added to the common pipeline. As such no jobs are added unless specifically enabled by
# the presence of a special file named ".release-it.json" in the root of the repository.
#
# Set the RELEASE_IT_DISABLED variable to disable release-it jobs if they are erroneously enabled.
#
# The USE_MERGE_REQUEST_RELEASE_FLOW variable is not namespaced. To avoid breaking existing users, this variable is left
# as is.
include:
- local: /fragments/get-gcp-secrets.yml
.release-base:
.release-it:base:
image:
name: registry.gitlab.developers.cam.ac.uk/uis/devops/infra/dockerimages/release-it:latest
variables:
......@@ -40,24 +48,30 @@ include:
tags:
- $GKE_RUNNER_TAG
update-release-merge-request:
extends: .release-base
release-it:update-release-merge-request:
extends: .release-it:base
stage: development
script: /opt/devops/update-merge-request.sh
needs: []
rules:
- if: $RELEASE_IT_DISABLED
when: never
# This job should only run if this variable is not null.
- if: $USE_MERGE_REQUEST_RELEASE_FLOW == null
when: never
# This is the main rule to run this job if we're using the merge request workflow and the pipeline is running on
# either the default branch or a branch named "release/fix-...".
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /^release\/fix-.*$/i) && $CI_COMMIT_MESSAGE !~ /chore\(release\)/
exists:
- .release-it.json
release:
extends: .release-base
release-it:release:
extends: .release-it:base
stage: production
script: /opt/devops/release.sh
rules:
- if: $RELEASE_IT_DISABLED
when: never
# This rule stops the job running if it is a new or rebased branch ($CI_COMMIT_BEFORE_SHA ==
# "0000000000000000000000000000000000000000") or if the pipeline was manually triggered via the web UI but only if
# we're using the merge request workflow.
......@@ -66,6 +80,8 @@ release:
# When using the merge request workflow, this release job should only trigger for pipelines on the default branch or
# branches starting "release/fix-" and only if the automated release bot commit was merged as the most recent commit.
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /^release\/fix-.*$/i) && $USE_MERGE_REQUEST_RELEASE_FLOW && $CI_COMMIT_MESSAGE =~ /chore\(release\)/
exists:
- .release-it.json
# If we're using the merge request workflow but all previous rules have not matched then we do not run the
# release job.
- if: $USE_MERGE_REQUEST_RELEASE_FLOW
......@@ -74,3 +90,5 @@ release:
# default branch or a branch starting "release/fix-". Note that we don't run the job if the last commit was the release
# commit by the bot account otherwise we'll get stuck in an infinite loop.
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /^release\/fix-.*$/i) && $CI_COMMIT_MESSAGE !~ /chore\(release\)/
exists:
- .release-it.json