Commit 43844925 authored by Mitchell Cash's avatar Mitchell Cash Committed by Thong Kuah

Fix Auto DevOps deploys that use a default branch that's not `master`

parent dbe5012f
---
title: Fix Auto DevOps deploys that use a default branch that's not named 'master'
merge_request: 53280
author: Mitchell Cash @MitchellCash
type: fixed
......@@ -23,7 +23,7 @@ review:
rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- if: '$REVIEW_DISABLED'
when: never
......@@ -44,7 +44,7 @@ stop_review:
rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- if: '$REVIEW_DISABLED'
when: never
......@@ -73,7 +73,7 @@ staging:
rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never
- if: '$CI_COMMIT_BRANCH != "master"'
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
- if: '$STAGING_ENABLED'
......@@ -98,7 +98,7 @@ canary:
rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never
- if: '$CI_COMMIT_BRANCH != "master"'
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
- if: '$CANARY_ENABLED'
when: manual
......@@ -136,7 +136,7 @@ production:
when: never
- if: '$INCREMENTAL_ROLLOUT_MODE'
when: never
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
production_manual:
<<: *production_template
......@@ -148,9 +148,9 @@ production_manual:
when: never
- if: '$INCREMENTAL_ROLLOUT_MODE'
when: never
- if: '$CI_COMMIT_BRANCH == "master" && $STAGING_ENABLED'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $STAGING_ENABLED'
when: manual
- if: '$CI_COMMIT_BRANCH == "master" && $CANARY_ENABLED'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CANARY_ENABLED'
when: manual
# This job implements incremental rollout on for every push to `master`.
......@@ -184,7 +184,7 @@ production_manual:
when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "timed"'
when: never
- if: '$CI_COMMIT_BRANCH != "master"'
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
# $INCREMENTAL_ROLLOUT_ENABLED is for compatibility with pre-GitLab 11.4 syntax
- if: '$INCREMENTAL_ROLLOUT_MODE == "manual" || $INCREMENTAL_ROLLOUT_ENABLED'
......@@ -197,7 +197,7 @@ production_manual:
when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "manual"'
when: never
- if: '$CI_COMMIT_BRANCH != "master"'
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "timed"'
when: delayed
......
......@@ -23,7 +23,7 @@ review:
rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- if: '$REVIEW_DISABLED'
when: never
......@@ -44,7 +44,7 @@ stop_review:
rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- if: '$REVIEW_DISABLED'
when: never
......@@ -73,7 +73,7 @@ staging:
rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never
- if: '$CI_COMMIT_BRANCH != "master"'
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
- if: '$STAGING_ENABLED'
......@@ -98,7 +98,7 @@ canary:
rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never
- if: '$CI_COMMIT_BRANCH != "master"'
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
- if: '$CANARY_ENABLED'
when: manual
......@@ -135,7 +135,7 @@ production:
when: never
- if: '$INCREMENTAL_ROLLOUT_MODE'
when: never
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
production_manual:
<<: *production_template
......@@ -147,9 +147,9 @@ production_manual:
when: never
- if: '$INCREMENTAL_ROLLOUT_MODE'
when: never
- if: '$CI_COMMIT_BRANCH == "master" && $STAGING_ENABLED'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $STAGING_ENABLED'
when: manual
- if: '$CI_COMMIT_BRANCH == "master" && $CANARY_ENABLED'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CANARY_ENABLED'
when: manual
# This job implements incremental rollout on for every push to `master`.
......@@ -181,7 +181,7 @@ production_manual:
when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "timed"'
when: never
- if: '$CI_COMMIT_BRANCH != "master"'
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
# $INCREMENTAL_ROLLOUT_ENABLED is for compatibility with pre-GitLab 11.4 syntax
- if: '$INCREMENTAL_ROLLOUT_MODE == "manual" || $INCREMENTAL_ROLLOUT_ENABLED'
......@@ -194,7 +194,7 @@ production_manual:
when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "manual"'
when: never
- if: '$CI_COMMIT_BRANCH != "master"'
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "timed"'
when: delayed
......
......@@ -20,7 +20,7 @@ review_ec2:
when: never
- if: '$REVIEW_DISABLED'
when: never
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
......@@ -34,6 +34,6 @@ production_ec2:
when: never
- if: '$CI_KUBERNETES_ACTIVE'
when: never
- if: '$CI_COMMIT_BRANCH != "master"'
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
......@@ -46,7 +46,7 @@ review_ecs:
when: never
- if: '$REVIEW_DISABLED'
when: never
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
......@@ -62,7 +62,7 @@ stop_review_ecs:
when: never
- if: '$REVIEW_DISABLED'
when: never
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
when: manual
......@@ -81,7 +81,7 @@ review_fargate:
when: never
- if: '$REVIEW_DISABLED'
when: never
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
......@@ -97,7 +97,7 @@ stop_review_fargate:
when: never
- if: '$REVIEW_DISABLED'
when: never
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
when: manual
......@@ -109,7 +109,7 @@ production_ecs:
when: never
- if: '$CI_KUBERNETES_ACTIVE'
when: never
- if: '$CI_COMMIT_BRANCH != "master"'
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
......@@ -120,6 +120,6 @@ production_fargate:
when: never
- if: '$CI_KUBERNETES_ACTIVE'
when: never
- if: '$CI_COMMIT_BRANCH != "master"'
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
......@@ -194,7 +194,7 @@ FactoryBot.define do
filename,
content,
message: "Automatically created file #{filename}",
branch_name: 'master'
branch_name: project.default_branch_or_master
)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment