Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
43844925
Commit
43844925
authored
Feb 25, 2021
by
Mitchell Cash
Committed by
Thong Kuah
Feb 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Auto DevOps deploys that use a default branch that's not `master`
parent
dbe5012f
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
222 additions
and
209 deletions
+222
-209
changelogs/unreleased/auto-devops-default-branch-deploy.yml
changelogs/unreleased/auto-devops-default-branch-deploy.yml
+5
-0
lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
+9
-9
lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml
lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml
+9
-9
lib/gitlab/ci/templates/Jobs/Deploy/EC2.gitlab-ci.yml
lib/gitlab/ci/templates/Jobs/Deploy/EC2.gitlab-ci.yml
+2
-2
lib/gitlab/ci/templates/Jobs/Deploy/ECS.gitlab-ci.yml
lib/gitlab/ci/templates/Jobs/Deploy/ECS.gitlab-ci.yml
+6
-6
spec/factories/projects.rb
spec/factories/projects.rb
+1
-1
spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb
...ib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb
+190
-182
No files found.
changelogs/unreleased/auto-devops-default-branch-deploy.yml
0 → 100644
View file @
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
lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
View file @
43844925
...
...
@@ -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
...
...
lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml
View file @
43844925
...
...
@@ -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
...
...
lib/gitlab/ci/templates/Jobs/Deploy/EC2.gitlab-ci.yml
View file @
43844925
...
...
@@ -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'
lib/gitlab/ci/templates/Jobs/Deploy/ECS.gitlab-ci.yml
View file @
43844925
...
...
@@ -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'
spec/factories/projects.rb
View file @
43844925
...
...
@@ -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
...
...
spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb
View file @
43844925
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment