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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
d9fb27f4
Commit
d9fb27f4
authored
Feb 27, 2019
by
Grzegorz Bizon
Committed by
Lin Jen-Shin
Mar 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make serverless template a valid abstract template
parent
b1ef8391
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
10 deletions
+34
-10
lib/gitlab/ci/templates/Serverless.gitlab-ci.yml
lib/gitlab/ci/templates/Serverless.gitlab-ci.yml
+0
-7
spec/lib/gitlab/ci/templates/templates_spec.rb
spec/lib/gitlab/ci/templates/templates_spec.rb
+34
-3
No files found.
lib/gitlab/ci/templates/Serverless.gitlab-ci.yml
View file @
d9fb27f4
...
...
@@ -39,10 +39,3 @@ stages:
-
tm -n "$KUBE_NAMESPACE" set registry-auth gitlab-registry --registry "$CI_REGISTRY" --username "$CI_REGISTRY_USER" --password "$CI_JOB_TOKEN" --push
-
tm -n "$KUBE_NAMESPACE" set registry-auth gitlab-registry --registry "$CI_REGISTRY" --username "$CI_DEPLOY_USER" --password "$CI_DEPLOY_PASSWORD" --pull
-
tm -n "$KUBE_NAMESPACE" deploy --wait
deploy-functions
:
extends
:
.serverless:deploy:functions
environment
:
production
only
:
variables
:
-
$CI_COMMIT_MESSAGE =~ /\[serverless deploy-functions\]/
spec/lib/gitlab/ci/templates/templates_spec.rb
View file @
d9fb27f4
...
...
@@ -3,9 +3,40 @@
require
'spec_helper'
describe
"CI YML Templates"
do
Gitlab
::
Template
::
GitlabCiYmlTemplate
.
all
.
each
do
|
template
|
it
"
#{
template
.
name
}
should be valid"
do
expect
{
Gitlab
::
Ci
::
YamlProcessor
.
new
(
template
.
content
)
}.
not_to
raise_error
ABSTRACT_TEMPLATES
=
%w[Serverless]
def
self
.
concrete_templates
Gitlab
::
Template
::
GitlabCiYmlTemplate
.
all
.
reject
do
|
template
|
ABSTRACT_TEMPLATES
.
include?
(
template
.
name
)
end
end
def
self
.
abstract_templates
Gitlab
::
Template
::
GitlabCiYmlTemplate
.
all
.
select
do
|
template
|
ABSTRACT_TEMPLATES
.
include?
(
template
.
name
)
end
end
describe
'concrete templates with CI/CD jobs'
do
concrete_templates
.
each
do
|
template
|
it
"
#{
template
.
name
}
template should be valid"
do
expect
{
Gitlab
::
Ci
::
YamlProcessor
.
new
(
template
.
content
)
}
.
not_to
raise_error
end
end
end
describe
'abstract templates without concrete jobs defined'
do
abstract_templates
.
each
do
|
template
|
it
"
#{
template
.
name
}
template should be valid after being implemented"
do
content
=
template
.
content
+
<<~
EOS
concrete_build_implemented_by_a_user:
stage: build
script: do something
EOS
expect
{
Gitlab
::
Ci
::
YamlProcessor
.
new
(
content
)
}.
not_to
raise_error
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