UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Commit efa80ced authored by Zachariah Dzielinski's avatar Zachariah Dzielinski
Browse files

ci: Modifying and cleaning workflow rules to enforce pipelines for merge requests

parent ef10c5c0
No related branches found
No related tags found
1 merge request!129BB-1081 - Modify Umbrella workflow rules to restrict pipelines for merge requests / general clean up of workflow rules
Pipeline #119296 failed
# Define global rules for when pipelines run
# global rules for when pipelines run
workflow:
rules:
# Skip pipeline when commit message starts with "wip"
- if: '$CI_COMMIT_MESSAGE =~ /^wip/'
when: never
# Skip pipeline for branches that start with "docs"
- if: '$CI_COMMIT_REF_NAME =~ /^docs/'
when: never
- when: always
# run pipeline for manual tag events
- if: $CI_COMMIT_TAG
# run pipeline on merge request events
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# run pipeline on commits to default branch
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# include templates
include:
......@@ -84,11 +83,6 @@ clean install:
stage: smoke tests
extends:
- .k3d
rules:
# Skip on merge requests (it is ran as part of the non MR pipeline)
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- when: always
variables:
CLUSTER_NAME: "clean-${CI_COMMIT_SHORT_SHA}"
script:
......@@ -108,7 +102,9 @@ upgrade:
extends:
- .k3d
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE !~ /^Breaking Change/'
# skip job when MR title starts with 'Breaking Change'
- if: $CI_MERGE_REQUEST_TITLE =~ /^Breaking Change/'
when: never
variables:
CLUSTER_NAME: "clean-${CI_COMMIT_SHORT_SHA}"
script:
......@@ -126,9 +122,6 @@ upgrade:
package:
stage: package
image: registry.dsop.io/platform-one/big-bang/umbrella/synker:0.0.1
rules:
- if: '$CI_COMMIT_TAG'
- when: never
dependencies:
- clean install
before_script:
......@@ -165,8 +158,11 @@ release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: '$CI_COMMIT_TAG'
- when: never
# skip job for manual tag events
- if: $CI_COMMIT_TAG
when: never
# run job on commits to default branch
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
variables:
RELEASE_ENDPOINT: https://${RELEASE_BUCKET}.s3-${AWS_DEFAULT_REGION}.amazonaws.com/umbrella/${CI_COMMIT_TAG}
script:
......@@ -187,10 +183,10 @@ release:
.infra fork:
stage: network up
rules:
# Skip when branch name starts with "hotfix" or "patch"
# skip job when branch name starts with "hotfix" or "patch"
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^(hotfix|patch)/'
when: never
# Only run on merge requests when manually activated
# run job on merge requests when manually activated
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: manual
allow_failure: false
......@@ -198,22 +194,21 @@ release:
# Abstract for jobs responsible for creating infrastructure
.infra create:
rules:
# Skip when branch name starts with "hotfix" or "patch"
# skip job when branch name starts with "hotfix" or "patch"
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^(hotfix|patch)/'
when: never
# Only run on merge requests
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
# Abstract for jobs responsible for cleaning up infrastructure
.infra cleanup:
rules:
# Skip when branch name starts with "hotfix" or "patch"
# skip job when branch name starts with "hotfix" or "patch"
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^(hotfix|patch)/'
when: never
# Always run on merge requests
# run job on merge requests regardless of failure
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
allow_failure: true
when: always
#-----------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------
......@@ -236,6 +231,7 @@ aws/network down:
environment:
name: review/aws-${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}
action: stop
#-----------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------
......@@ -314,4 +310,5 @@ aws/rke2/cluster down:
- .rke2 down
needs:
- job: aws/rke2/bigbang down
#-----------------------------------------------------------------------------------------------------------------------
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment