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
c9819fc1
Commit
c9819fc1
authored
Mar 07, 2019
by
Victor Zagorodny
Committed by
Kamil Trzciński
Mar 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Dependency Scanning vendored template
parent
a9b8358d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
96 additions
and
5 deletions
+96
-5
ee/changelogs/unreleased/8661-add-ci-template-for-dependency-scanning.yml
...released/8661-add-ci-template-for-dependency-scanning.yml
+5
-0
ee/lib/ee/gitlab/template/gitlab_ci_yml_template.rb
ee/lib/ee/gitlab/template/gitlab_ci_yml_template.rb
+28
-0
ee/spec/lib/ee/gitlab/template/gitlab_ci_yml_template_spec.rb
...pec/lib/ee/gitlab/template/gitlab_ci_yml_template_spec.rb
+15
-0
lib/gitlab/ci/templates/Security/Dependency-Scanning.gitlab-ci.yml
...b/ci/templates/Security/Dependency-Scanning.gitlab-ci.yml
+44
-0
lib/gitlab/template/gitlab_ci_yml_template.rb
lib/gitlab/template/gitlab_ci_yml_template.rb
+2
-5
spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb
spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb
+2
-0
No files found.
ee/changelogs/unreleased/8661-add-ci-template-for-dependency-scanning.yml
0 → 100644
View file @
c9819fc1
---
title
:
Added vendored CI/CD template for Dependency Scanning job
merge_request
:
9660
author
:
type
:
added
ee/lib/ee/gitlab/template/gitlab_ci_yml_template.rb
0 → 100644
View file @
c9819fc1
# frozen_string_literal: true
module
EE
module
Gitlab
module
Template
module
GitlabCiYmlTemplate
extend
ActiveSupport
::
Concern
class_methods
do
extend
::
Gitlab
::
Utils
::
Override
override
:categories
def
categories
super
.
merge
(
categories_ee
)
end
private
def
categories_ee
{
'Security'
=>
'Security'
}
end
end
end
end
end
end
ee/spec/lib/ee/gitlab/template/gitlab_ci_yml_template_spec.rb
0 → 100644
View file @
c9819fc1
# frozen_string_literal: true
require
'spec_helper'
describe
Gitlab
::
Template
::
GitlabCiYmlTemplate
do
subject
{
described_class
}
describe
'.all'
do
it
'finds the Security Products templates'
do
all
=
subject
.
all
.
map
(
&
:name
)
expect
(
all
).
to
include
(
'Dependency-Scanning'
)
end
end
end
lib/gitlab/ci/templates/Security/Dependency-Scanning.gitlab-ci.yml
0 → 100644
View file @
c9819fc1
# Read more about this feature here: https://docs.gitlab.com/ee/user/project/merge_requests/dependency_scanning.html
#
# Configure the scanning tool through the environment variables.
# List of the variables: https://gitlab.com/gitlab-org/security-products/dependency-scanning#settings
# How to set: https://docs.gitlab.com/ee/ci/yaml/#variables
stages
:
-
test
dependency_scanning
:
stage
:
test
image
:
docker:stable
variables
:
DOCKER_DRIVER
:
overlay2
allow_failure
:
true
services
:
-
docker:stable-dind
script
:
-
export DS_VERSION=${SP_VERSION:-$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')}
-
|
docker run \
--env DS_ANALYZER_IMAGES \
--env DS_ANALYZER_IMAGE_PREFIX \
--env DS_ANALYZER_IMAGE_TAG \
--env DS_DEFAULT_ANALYZERS \
--env DEP_SCAN_DISABLE_REMOTE_CHECKS \
--env DS_DOCKER_CLIENT_NEGOTIATION_TIMEOUT \
--env DS_PULL_ANALYZER_IMAGE_TIMEOUT \
--env DS_RUN_ANALYZER_TIMEOUT \
--volume "$PWD:/code" \
--volume /var/run/docker.sock:/var/run/docker.sock \
"registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$DS_VERSION" /code
artifacts
:
reports
:
dependency_scanning
:
gl-dependency-scanning-report.json
dependencies
:
[]
only
:
refs
:
-
branches
variables
:
-
$GITLAB_FEATURES =~ /\bdependency_scanning\b/
except
:
variables
:
-
$DEPENDENCY_SCANNING_DISABLED
lib/gitlab/template/gitlab_ci_yml_template.rb
View file @
c9819fc1
...
...
@@ -28,12 +28,9 @@ module Gitlab
def
finder
(
project
=
nil
)
Gitlab
::
Template
::
Finders
::
GlobalTemplateFinder
.
new
(
self
.
base_dir
,
self
.
extension
,
self
.
categories
)
end
def
dropdown_names
(
context
)
categories
=
context
==
'autodeploy'
?
[
'Auto deploy'
]
:
%w(General Pages)
super
().
slice
(
*
categories
)
end
end
end
end
end
Gitlab
::
Template
::
GitlabCiYmlTemplate
.
prepend
(
::
EE
::
Gitlab
::
Template
::
GitlabCiYmlTemplate
)
spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb
View file @
c9819fc1
# frozen_string_literal: true
require
'spec_helper'
describe
Gitlab
::
Template
::
GitlabCiYmlTemplate
do
...
...
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