Commit bf99d5e3 authored by Thong Kuah's avatar Thong Kuah

Merge branch 'auto-devops-default-branch-deploy' into 'master'

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

See merge request gitlab-org/gitlab!53280
parents fb130c7e 43844925
---
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: ...@@ -23,7 +23,7 @@ review:
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
...@@ -44,7 +44,7 @@ stop_review: ...@@ -44,7 +44,7 @@ stop_review:
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
...@@ -73,7 +73,7 @@ staging: ...@@ -73,7 +73,7 @@ staging:
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never when: never
- if: '$CI_COMMIT_BRANCH != "master"' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$STAGING_ENABLED' - if: '$STAGING_ENABLED'
...@@ -98,7 +98,7 @@ canary: ...@@ -98,7 +98,7 @@ canary:
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never when: never
- if: '$CI_COMMIT_BRANCH != "master"' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$CANARY_ENABLED' - if: '$CANARY_ENABLED'
when: manual when: manual
...@@ -136,7 +136,7 @@ production: ...@@ -136,7 +136,7 @@ production:
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE' - if: '$INCREMENTAL_ROLLOUT_MODE'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
production_manual: production_manual:
<<: *production_template <<: *production_template
...@@ -148,9 +148,9 @@ production_manual: ...@@ -148,9 +148,9 @@ production_manual:
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE' - if: '$INCREMENTAL_ROLLOUT_MODE'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master" && $STAGING_ENABLED' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $STAGING_ENABLED'
when: manual when: manual
- if: '$CI_COMMIT_BRANCH == "master" && $CANARY_ENABLED' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CANARY_ENABLED'
when: manual when: manual
# This job implements incremental rollout on for every push to `master`. # This job implements incremental rollout on for every push to `master`.
...@@ -184,7 +184,7 @@ production_manual: ...@@ -184,7 +184,7 @@ production_manual:
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "timed"' - if: '$INCREMENTAL_ROLLOUT_MODE == "timed"'
when: never when: never
- if: '$CI_COMMIT_BRANCH != "master"' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
# $INCREMENTAL_ROLLOUT_ENABLED is for compatibility with pre-GitLab 11.4 syntax # $INCREMENTAL_ROLLOUT_ENABLED is for compatibility with pre-GitLab 11.4 syntax
- if: '$INCREMENTAL_ROLLOUT_MODE == "manual" || $INCREMENTAL_ROLLOUT_ENABLED' - if: '$INCREMENTAL_ROLLOUT_MODE == "manual" || $INCREMENTAL_ROLLOUT_ENABLED'
...@@ -197,7 +197,7 @@ production_manual: ...@@ -197,7 +197,7 @@ production_manual:
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "manual"' - if: '$INCREMENTAL_ROLLOUT_MODE == "manual"'
when: never when: never
- if: '$CI_COMMIT_BRANCH != "master"' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "timed"' - if: '$INCREMENTAL_ROLLOUT_MODE == "timed"'
when: delayed when: delayed
......
...@@ -23,7 +23,7 @@ review: ...@@ -23,7 +23,7 @@ review:
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
...@@ -44,7 +44,7 @@ stop_review: ...@@ -44,7 +44,7 @@ stop_review:
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
...@@ -73,7 +73,7 @@ staging: ...@@ -73,7 +73,7 @@ staging:
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never when: never
- if: '$CI_COMMIT_BRANCH != "master"' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$STAGING_ENABLED' - if: '$STAGING_ENABLED'
...@@ -98,7 +98,7 @@ canary: ...@@ -98,7 +98,7 @@ canary:
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never when: never
- if: '$CI_COMMIT_BRANCH != "master"' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$CANARY_ENABLED' - if: '$CANARY_ENABLED'
when: manual when: manual
...@@ -135,7 +135,7 @@ production: ...@@ -135,7 +135,7 @@ production:
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE' - if: '$INCREMENTAL_ROLLOUT_MODE'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
production_manual: production_manual:
<<: *production_template <<: *production_template
...@@ -147,9 +147,9 @@ production_manual: ...@@ -147,9 +147,9 @@ production_manual:
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE' - if: '$INCREMENTAL_ROLLOUT_MODE'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master" && $STAGING_ENABLED' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $STAGING_ENABLED'
when: manual when: manual
- if: '$CI_COMMIT_BRANCH == "master" && $CANARY_ENABLED' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CANARY_ENABLED'
when: manual when: manual
# This job implements incremental rollout on for every push to `master`. # This job implements incremental rollout on for every push to `master`.
...@@ -181,7 +181,7 @@ production_manual: ...@@ -181,7 +181,7 @@ production_manual:
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "timed"' - if: '$INCREMENTAL_ROLLOUT_MODE == "timed"'
when: never when: never
- if: '$CI_COMMIT_BRANCH != "master"' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
# $INCREMENTAL_ROLLOUT_ENABLED is for compatibility with pre-GitLab 11.4 syntax # $INCREMENTAL_ROLLOUT_ENABLED is for compatibility with pre-GitLab 11.4 syntax
- if: '$INCREMENTAL_ROLLOUT_MODE == "manual" || $INCREMENTAL_ROLLOUT_ENABLED' - if: '$INCREMENTAL_ROLLOUT_MODE == "manual" || $INCREMENTAL_ROLLOUT_ENABLED'
...@@ -194,7 +194,7 @@ production_manual: ...@@ -194,7 +194,7 @@ production_manual:
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "manual"' - if: '$INCREMENTAL_ROLLOUT_MODE == "manual"'
when: never when: never
- if: '$CI_COMMIT_BRANCH != "master"' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$INCREMENTAL_ROLLOUT_MODE == "timed"' - if: '$INCREMENTAL_ROLLOUT_MODE == "timed"'
when: delayed when: delayed
......
...@@ -20,7 +20,7 @@ review_ec2: ...@@ -20,7 +20,7 @@ review_ec2:
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
...@@ -34,6 +34,6 @@ production_ec2: ...@@ -34,6 +34,6 @@ production_ec2:
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE' - if: '$CI_KUBERNETES_ACTIVE'
when: never when: never
- if: '$CI_COMMIT_BRANCH != "master"' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
...@@ -46,7 +46,7 @@ review_ecs: ...@@ -46,7 +46,7 @@ review_ecs:
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
...@@ -62,7 +62,7 @@ stop_review_ecs: ...@@ -62,7 +62,7 @@ stop_review_ecs:
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
when: manual when: manual
...@@ -81,7 +81,7 @@ review_fargate: ...@@ -81,7 +81,7 @@ review_fargate:
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
...@@ -97,7 +97,7 @@ stop_review_fargate: ...@@ -97,7 +97,7 @@ stop_review_fargate:
when: never when: never
- if: '$REVIEW_DISABLED' - if: '$REVIEW_DISABLED'
when: never when: never
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
when: manual when: manual
...@@ -109,7 +109,7 @@ production_ecs: ...@@ -109,7 +109,7 @@ production_ecs:
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE' - if: '$CI_KUBERNETES_ACTIVE'
when: never when: never
- if: '$CI_COMMIT_BRANCH != "master"' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
...@@ -120,6 +120,6 @@ production_fargate: ...@@ -120,6 +120,6 @@ production_fargate:
when: never when: never
- if: '$CI_KUBERNETES_ACTIVE' - if: '$CI_KUBERNETES_ACTIVE'
when: never when: never
- if: '$CI_COMMIT_BRANCH != "master"' - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
...@@ -194,7 +194,7 @@ FactoryBot.define do ...@@ -194,7 +194,7 @@ FactoryBot.define do
filename, filename,
content, content,
message: "Automatically created file #{filename}", message: "Automatically created file #{filename}",
branch_name: 'master' branch_name: project.default_branch_or_master
) )
end end
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