Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@ platform:
arch: amd64

steps:
- name: dependencies
image: golang:1.14
commands:
- curl -sL https://deb.nodesource.com/setup_12.x | bash -
- apt-get install -y nodejs
- npm install -g snyk
- snyk test --org=cloud
environment:
SNYK_TOKEN:
from_secret: snyk_token
when:
branch:
- master
event:
- push

- name: test
image: golang:1.14
commands:
Expand Down
29 changes: 29 additions & 0 deletions build/ci/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,29 @@ functions:
set -Eeou pipefail

curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh
"install snyk":
- command: shell.exec
type: setup
params:
working_dir: src/github.com/mongodb/mongocli/bin
script: |
set -Eeou pipefail

curl -sfL https://github.com/snyk/snyk/releases/download/v${snyk_ver}/snyk-linux -o snyk
chmod +x snyk
"snyk scan":
- command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongocli
script: |
export SNYK_TOKEN=${snyk_token}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: export before set and also more exports below

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, missing ""

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before because it's a secret, it's an evergreen thing do move these kind of expansions before the sets also for expansions we usually don't use quotes("") but I can try it


set -Eeou pipefail

export GOROOT="${go_root}"
export PATH="./bin:$GOROOT/bin:$PATH"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is GOROOT needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left them because I'm not sure if snyk needs a working go env to run, if there's no GOROOT set go complains a lot, it has a default usually but that's not set on evergreen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, goroot is needed, test here without it

./bin/snyk test --org=cloud
"install curator":
- command: shell.exec
type: setup
Expand Down Expand Up @@ -355,6 +378,12 @@ tasks:
- func: "clone"
- func: "install golangci-lint"
- func: "lint"
- name: snyk_scan
tags: ["code_health"]
commands:
- func: "clone"
- func: "install snyk"
- func: "snyk scan"
- name: config_e2e
tags: ["e2e","generic"]
depends_on:
Expand Down