Skip to content

Commit 3bf3f2e

Browse files
authored
CLOUDP-66895: Move snyk scanner to evergreen (#311)
1 parent 9ec0ac6 commit 3bf3f2e

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

.drone.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,6 @@ platform:
88
arch: amd64
99

1010
steps:
11-
- name: dependencies
12-
image: golang:1.14
13-
commands:
14-
- curl -sL https://deb.nodesource.com/setup_12.x | bash -
15-
- apt-get install -y nodejs
16-
- npm install -g snyk
17-
- snyk test --org=cloud
18-
environment:
19-
SNYK_TOKEN:
20-
from_secret: snyk_token
21-
when:
22-
branch:
23-
- master
24-
event:
25-
- push
26-
2711
- name: test
2812
image: golang:1.14
2913
commands:

build/ci/evergreen.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,29 @@ functions:
167167
set -Eeou pipefail
168168
169169
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh
170+
"install snyk":
171+
- command: shell.exec
172+
type: setup
173+
params:
174+
working_dir: src/github.com/mongodb/mongocli/bin
175+
script: |
176+
set -Eeou pipefail
177+
178+
curl -sfL https://github.com/snyk/snyk/releases/download/v${snyk_ver}/snyk-linux -o snyk
179+
chmod +x snyk
180+
"snyk scan":
181+
- command: shell.exec
182+
type: test
183+
params:
184+
working_dir: src/github.com/mongodb/mongocli
185+
script: |
186+
export SNYK_TOKEN=${snyk_token}
187+
188+
set -Eeou pipefail
189+
190+
export GOROOT="${go_root}"
191+
export PATH="./bin:$GOROOT/bin:$PATH"
192+
./bin/snyk test --org=cloud
170193
"install curator":
171194
- command: shell.exec
172195
type: setup
@@ -355,6 +378,12 @@ tasks:
355378
- func: "clone"
356379
- func: "install golangci-lint"
357380
- func: "lint"
381+
- name: snyk_scan
382+
tags: ["code_health"]
383+
commands:
384+
- func: "clone"
385+
- func: "install snyk"
386+
- func: "snyk scan"
358387
- name: config_e2e
359388
tags: ["e2e","generic"]
360389
depends_on:

0 commit comments

Comments
 (0)