Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CI tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Dehennin
CI tools
Commits
3180993f
Commit
3180993f
authored
3 years ago
by
Daniel Dehennin
Browse files
Options
Downloads
Plain Diff
Merge branch 'testing' into stable
parents
d096d7e8
adc45212
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
templates/Release/Semantic-release.yaml
+4
-5
4 additions, 5 deletions
templates/Release/Semantic-release.yaml
templates/Rules.yaml
+85
-71
85 additions, 71 deletions
templates/Rules.yaml
with
89 additions
and
76 deletions
templates/Release/Semantic-release.yaml
+
4
−
5
View file @
3180993f
...
...
@@ -46,14 +46,13 @@
#
# We can't merge rules with `!reference` until we switch to Gitlab >= 14.3
# https://gitlab.com/gitlab-org/gitlab/-/issues/322992
# Use a `.rules-map` as a workaround
.on-stable-with-semantic-release-config
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"schedule"'
when
:
never
# Exclude semantic-release commits on $STABLE_BRANCH
-
if
:
$CI_COMMIT_BRANCH == $STABLE_BRANCH && $CI_COMMIT_MESSAGE =~ /^chore\(release\):/
when
:
never
-
!reference
[
.rules-map
,
not-on-schedule
]
-
!reference
[
.rules-map
,
not-on-draft
]
-
!reference
[
.rules-map
,
not-on-semantic-release-commit
]
-
if
:
$CI_COMMIT_BRANCH == $STABLE_BRANCH
exists
:
-
release.config.js
...
...
This diff is collapsed.
Click to expand it.
templates/Rules.yaml
+
85
−
71
View file @
3180993f
...
...
@@ -37,6 +37,7 @@
# - `wip foo`
# - `foo (draft)`
# - `foo [WIP]`
# - message generated by `semantic-release`
---
variables
:
STABLE_BRANCH
:
stable
...
...
@@ -47,97 +48,110 @@ variables:
BUGFIX_PREFIX
:
bugfix/
FEATURE_PREFIX
:
feature/
# This rules template should be used as the default rules.
# It select all branches except the stable one.
# We always exclude schedules.
.not-on-stable
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"schedule"'
when
:
never
-
if
:
$CI_COMMIT_BRANCH == $STABLE_BRANCH
when
:
never
# Exclude `Draft` or `WIP` messages
-
if
:
$CI_COMMIT_MESSAGE =~ /(?:draft|wip):|\[(?:draft|wip)\]|\((?:draft|wip)\)/i
when
:
never
-
if
:
$CI_COMMIT_BRANCH
when
:
on_success
-
!reference
[
.rules-map
,
not-on-schedule
]
-
!reference
[
.rules-map
,
not-on-stable
]
-
!reference
[
.rules-map
,
not-on-draft
]
-
!reference
[
.rules-map
,
not-on-semantic-release-commit
]
-
!reference
[
.rules-map
,
on-branch
]
# Select only branches that are not stable, testing or development.
# We always exclude schedules.
.on-branches
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"schedule"'
when
:
never
-
if
:
$CI_COMMIT_TAG
when
:
never
-
if
:
$CI_COMMIT_BRANCH == $STABLE_BRANCH
when
:
never
-
if
:
$CI_COMMIT_BRANCH == $TESTING_BRANCH
when
:
never
-
if
:
$CI_COMMIT_BRANCH == $DEV_BRANCH
when
:
never
# Exclude `Draft` or `WIP` messages
-
if
:
$CI_COMMIT_MESSAGE =~ /(?:draft|wip):|\[(?:draft|wip)\]|\((?:draft|wip)\)/i
when
:
never
-
if
:
$CI_COMMIT_BRANCH
when
:
on_success
-
!reference
[
.rules-map
,
not-on-schedule
]
-
!reference
[
.rules-map
,
not-on-tag
]
-
!reference
[
.rules-map
,
not-on-stable
]
-
!reference
[
.rules-map
,
not-on-testing
]
-
!reference
[
.rules-map
,
not-on-dev
]
-
!reference
[
.rules-map
,
not-on-draft
]
-
!reference
[
.rules-map
,
not-on-semantic-release-commit
]
-
!reference
[
.rules-map
,
on-branch
]
# Select the developpment branch except for commits comming from `semantic-release`
# We always exclude schedules.
# Select the developpment branch
.on-dev
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"schedule"'
when
:
never
# Exclude `Draft` or `WIP` messages
-
if
:
$CI_COMMIT_MESSAGE =~ /(?:draft|wip):|\[(?:draft|wip)\]|\((?:draft|wip)\)/i
when
:
never
# Exclude $CI_DEFAULT_BRANCH of semantic-release commits
-
if
:
$CI_COMMIT_BRANCH == $DEV_BRANCH && $CI_COMMIT_MESSAGE =~ /^chore\(release\):/
when
:
never
-
if
:
$CI_COMMIT_BRANCH == $DEV_BRANCH
when
:
on_success
-
!reference
[
.rules-map
,
not-on-schedule
]
-
!reference
[
.rules-map
,
not-on-draft
]
-
!reference
[
.rules-map
,
not-on-semantic-release-commit
]
-
!reference
[
.rules-map
,
on-dev
]
# Select the pre-release testing branch except for commits comming from `semantic-release`
# We always exclude schedules.
# Select the pre-release testing branch
.on-testing
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"schedule"'
when
:
never
# Exclude `Draft` or `WIP` messages
-
if
:
$CI_COMMIT_MESSAGE =~ /(?:draft|wip):|\[(?:draft|wip)\]|\((?:draft|wip)\)/i
when
:
never
# Exclude $CI_DEFAULT_BRANCH of semantic-release commits
-
if
:
$CI_COMMIT_BRANCH == $TESTING_BRANCH && $CI_COMMIT_MESSAGE =~ /^chore\(release\):/
when
:
never
-
if
:
$CI_COMMIT_BRANCH == $TESTING_BRANCH
when
:
on_success
-
!reference
[
.rules-map
,
not-on-schedule
]
-
!reference
[
.rules-map
,
not-on-draft
]
-
!reference
[
.rules-map
,
not-on-semantic-release-commit
]
-
!reference
[
.rules-map
,
on-testing
]
# Select the stable branch except for commits comming from `semantic-release`
# We always exclude schedules.
# Select the stable branch
.on-stable
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"schedule"'
when
:
never
# Exclude `Draft` or `WIP` messages
-
if
:
$CI_COMMIT_MESSAGE =~ /(?:draft|wip):|\[(?:draft|wip)\]|\((?:draft|wip)\)/i
when
:
never
# Exclude $CI_DEFAULT_BRANCH of semantic-release commits
-
if
:
$CI_COMMIT_BRANCH == $STABLE_BRANCH && $CI_COMMIT_MESSAGE =~ /^chore\(release\):/
when
:
never
-
if
:
$CI_COMMIT_BRANCH == $STABLE_BRANCH
when
:
on_success
-
!reference
[
.rules-map
,
not-on-schedule
]
-
!reference
[
.rules-map
,
not-on-draft
]
-
!reference
[
.rules-map
,
not-on-semantic-release-commit
]
-
!reference
[
.rules-map
,
on-stable
]
# Select the protected release tags
# We always exclude schedules.
.on-release-tag
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"schedule"'
when
:
never
-
!reference
[
.rules-map
,
not-on-schedule
]
-
!reference
[
.rules-map
,
not-on-draft
]
-
!reference
[
.rules-map
,
on-release-tag
]
# We use a single rules hash to be referenced as array elements by
# individual rules templates above.
# This avoid the duplication of rules conditions
#
# SEE ALSO
# ========
#
# - https://forum.gitlab.com/t/add-conditions-to-rules-array-merged-with-reference/62600
# - https://gitlab.com/gitlab-org/gitlab/-/issues/322992
# - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67922
# - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67922
.rules-map
:
not-on-schedule
:
if
:
'
$CI_PIPELINE_SOURCE
==
"schedule"'
when
:
never
not-on-tag
:
if
:
$CI_COMMIT_TAG
when
:
never
not-on-stable
:
if
:
$CI_COMMIT_BRANCH == $STABLE_BRANCH
when
:
never
not-on-testing
:
if
:
$CI_COMMIT_BRANCH == $TESTING_BRANCH
when
:
never
not-on-dev
:
if
:
$CI_COMMIT_BRANCH == $DEV_BRANCH
when
:
never
not-on-draft
:
# Exclude `Draft` or `WIP` messages
-
if
:
$CI_COMMIT_MESSAGE =~ /(?:draft|wip):|\[(?:draft|wip)\]|\((?:draft|wip)\)/i
when
:
never
# Only for protected release tags
-
if
:
$CI_COMMIT_TAG =~ /^release\// && $CI_COMMIT_REF_PROTECTED
when
:
on_success
if
:
$CI_COMMIT_MESSAGE =~ /(?:draft|wip):|\[(?:draft|wip)\]|\((?:draft|wip)\)/i
when
:
never
not-on-semantic-release-commit
:
# Exclude $CI_DEFAULT_BRANCH of semantic-release commits
if
:
$CI_COMMIT_BRANCH && $CI_COMMIT_MESSAGE =~ /^chore\(release\):/
when
:
never
on-branch
:
if
:
$CI_COMMIT_BRANCH
when
:
on_success
on-stable
:
if
:
$CI_COMMIT_BRANCH == $STABLE_BRANCH
when
:
on_success
on-testing
:
if
:
$CI_COMMIT_BRANCH == $TESTING_BRANCH
when
:
on_success
on-dev
:
if
:
$CI_COMMIT_BRANCH == $DEV_BRANCH
when
:
on_success
on-tag
:
if
:
$CI_COMMIT_TAG
when
:
on_success
on-release-tag
:
if
:
$CI_COMMIT_TAG =~ /^release\// && $CI_COMMIT_REF_PROTECTED
when
:
on_success
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment