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
5d28cb54
Commit
5d28cb54
authored
Oct 27, 2020
by
Etienne Baqué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added stop review job for ECS
parent
eca2ef23
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
5 deletions
+60
-5
changelogs/unreleased/218167-stop-review-for-ecs.yml
changelogs/unreleased/218167-stop-review-for-ecs.yml
+5
-0
lib/gitlab/ci/templates/Jobs/Deploy/ECS.gitlab-ci.yml
lib/gitlab/ci/templates/Jobs/Deploy/ECS.gitlab-ci.yml
+53
-3
spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb
...ib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb
+2
-2
No files found.
changelogs/unreleased/218167-stop-review-for-ecs.yml
0 → 100644
View file @
5d28cb54
---
title
:
Add a stop review job for ECS
merge_request
:
44717
author
:
type
:
added
lib/gitlab/ci/templates/Jobs/Deploy/ECS.gitlab-ci.yml
View file @
5d28cb54
...
...
@@ -8,8 +8,11 @@
#
# More about including CI templates: https://docs.gitlab.com/ee/ci/yaml/#includetemplate
.
deploy_to_ecs
:
.
ecs_image
:
image
:
'
registry.gitlab.com/gitlab-org/cloud-deploy/aws-ecs:latest'
.deploy_to_ecs
:
extends
:
.ecs_image
dependencies
:
[]
script
:
-
ecs update-task-definition
...
...
@@ -17,8 +20,6 @@
.review_ecs_base
:
stage
:
review
extends
:
.deploy_to_ecs
environment
:
name
:
review/$CI_COMMIT_REF_NAME
.production_ecs_base
:
stage
:
production
...
...
@@ -26,8 +27,18 @@
environment
:
name
:
production
.stop_review_ecs_base
:
extends
:
.ecs_image
stage
:
cleanup
allow_failure
:
true
script
:
-
ecs stop-task
review_ecs
:
extends
:
.review_ecs_base
environment
:
name
:
review/$CI_COMMIT_REF_NAME
on_stop
:
stop_review_ecs
rules
:
-
if
:
'
$AUTO_DEVOPS_PLATFORM_TARGET
!=
"ECS"'
when
:
never
...
...
@@ -39,8 +50,46 @@ review_ecs:
when
:
never
-
if
:
'
$CI_COMMIT_TAG
||
$CI_COMMIT_BRANCH'
stop_review_ecs
:
extends
:
.stop_review_ecs_base
environment
:
name
:
review/$CI_COMMIT_REF_NAME
action
:
stop
rules
:
-
if
:
'
$AUTO_DEVOPS_PLATFORM_TARGET
!=
"ECS"'
when
:
never
-
if
:
'
$CI_KUBERNETES_ACTIVE'
when
:
never
-
if
:
'
$REVIEW_DISABLED'
when
:
never
-
if
:
'
$CI_COMMIT_BRANCH
==
"master"'
when
:
never
-
if
:
'
$CI_COMMIT_TAG
||
$CI_COMMIT_BRANCH'
when
:
manual
review_fargate
:
extends
:
.review_ecs_base
environment
:
name
:
review/$CI_COMMIT_REF_NAME
on_stop
:
stop_review_fargate
script
:
-
ecs update-task-definition
rules
:
-
if
:
'
$AUTO_DEVOPS_PLATFORM_TARGET
!=
"FARGATE"'
when
:
never
-
if
:
'
$CI_KUBERNETES_ACTIVE'
when
:
never
-
if
:
'
$REVIEW_DISABLED'
when
:
never
-
if
:
'
$CI_COMMIT_BRANCH
==
"master"'
when
:
never
-
if
:
'
$CI_COMMIT_TAG
||
$CI_COMMIT_BRANCH'
stop_review_fargate
:
extends
:
.stop_review_ecs_base
environment
:
name
:
review/$CI_COMMIT_REF_NAME
action
:
stop
rules
:
-
if
:
'
$AUTO_DEVOPS_PLATFORM_TARGET
!=
"FARGATE"'
when
:
never
...
...
@@ -51,6 +100,7 @@ review_fargate:
-
if
:
'
$CI_COMMIT_BRANCH
==
"master"'
when
:
never
-
if
:
'
$CI_COMMIT_TAG
||
$CI_COMMIT_BRANCH'
when
:
manual
production_ecs
:
extends
:
.production_ecs_base
...
...
spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb
View file @
5d28cb54
...
...
@@ -94,14 +94,14 @@ RSpec.describe 'Auto-DevOps.gitlab-ci.yml' do
end
it
'creates an ECS deployment job for review only'
do
expect
(
review_prod_build_names
).
to
contain_exactly
(
'review_ecs'
)
expect
(
review_prod_build_names
).
to
contain_exactly
(
'review_ecs'
,
'stop_review_ecs'
)
end
context
'with FARGATE as a launch type'
do
let
(
:platform_value
)
{
'FARGATE'
}
it
'creates an FARGATE deployment job for review only'
do
expect
(
review_prod_build_names
).
to
contain_exactly
(
'review_fargate'
)
expect
(
review_prod_build_names
).
to
contain_exactly
(
'review_fargate'
,
'stop_review_fargate'
)
end
end
end
...
...
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