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
66dcb465
Commit
66dcb465
authored
Nov 03, 2020
by
Etienne Baqué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added cleaup stage to Deploy-ECS
Added new rspec for the Deploy-ECS template.
parent
de7026df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
0 deletions
+60
-0
lib/gitlab/ci/templates/AWS/Deploy-ECS.gitlab-ci.yml
lib/gitlab/ci/templates/AWS/Deploy-ECS.gitlab-ci.yml
+1
-0
spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb
...gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb
+59
-0
No files found.
lib/gitlab/ci/templates/AWS/Deploy-ECS.gitlab-ci.yml
View file @
66dcb465
...
...
@@ -4,6 +4,7 @@ stages:
-
review
-
deploy
-
production
-
cleanup
variables
:
AUTO_DEVOPS_PLATFORM_TARGET
:
ECS
...
...
spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb
0 → 100644
View file @
66dcb465
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Deploy-ECS.gitlab-ci.yml'
do
subject
(
:template
)
{
Gitlab
::
Template
::
GitlabCiYmlTemplate
.
find
(
'AWS/Deploy-ECS'
)
}
describe
'the created pipeline'
do
let_it_be
(
:user
)
{
create
(
:admin
)
}
let
(
:default_branch
)
{
'master'
}
let
(
:pipeline_branch
)
{
default_branch
}
let
(
:project
)
{
create
(
:project
,
:auto_devops
,
:custom_repo
,
files:
{
'README.md'
=>
''
})
}
let
(
:service
)
{
Ci
::
CreatePipelineService
.
new
(
project
,
user
,
ref:
pipeline_branch
)
}
let
(
:pipeline
)
{
service
.
execute!
(
:push
)
}
let
(
:build_names
)
{
pipeline
.
builds
.
pluck
(
:name
)
}
let
(
:platform_target
)
{
'ECS'
}
before
do
create
(
:ci_variable
,
project:
project
,
key:
'AUTO_DEVOPS_PLATFORM_TARGET'
,
value:
platform_target
)
stub_ci_pipeline_yaml_file
(
template
.
content
)
allow_any_instance_of
(
Ci
::
BuildScheduleWorker
).
to
receive
(
:perform
).
and_return
(
true
)
allow
(
project
).
to
receive
(
:default_branch
).
and_return
(
default_branch
)
end
shared_examples
'no pipeline yaml error'
do
it
'does not have any error'
do
expect
(
pipeline
.
has_yaml_errors?
).
to
be_falsey
end
end
it_behaves_like
'no pipeline yaml error'
it
'creates the expected jobs'
do
expect
(
build_names
).
to
include
(
'production_ecs'
)
end
context
'when running a pipeline for a branch'
do
let
(
:pipeline_branch
)
{
'test_branch'
}
before
do
project
.
repository
.
create_branch
(
pipeline_branch
)
end
it_behaves_like
'no pipeline yaml error'
it
'creates the expected jobs'
do
expect
(
build_names
).
to
include
(
'review_ecs'
,
'stop_review_ecs'
)
end
context
'when deploying to ECS Fargate'
do
let
(
:platform_target
)
{
'FARGATE'
}
it
'creates the expected jobs'
do
expect
(
build_names
).
to
include
(
'review_fargate'
,
'stop_review_fargate'
)
end
end
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