forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup periodic snyk monitoring per branch (elastic#88522)
Adds a new ci Jenkins job configuration for running snyk dependency monitoring on a daily basis. We setup a service account in snyk and resolve the api token for publishing in vault. Related to elastic#87620
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
.ci/jobs.t/elastic+elasticsearch+periodic+snyk-dependency-monitoring-trigger.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
jjbb-template: periodic-trigger-lgc.yml | ||
vars: | ||
- periodic-job: elastic+elasticsearch+%BRANCH%+snyk-dependency-monitoring | ||
- lgc-job: elastic+elasticsearch+%BRANCH%+intake | ||
- cron: "H H * * *" |
22 changes: 22 additions & 0 deletions
22
.ci/jobs.t/elastic+elasticsearch+periodic+snyk-dependency-monitoring.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
- job: | ||
name: elastic+elasticsearch+%BRANCH%+snyk-dependency-monitoring | ||
workspace: /dev/shm/elastic+elasticsearch+%BRANCH%+snyk-dependency-monitoring | ||
display-name: "elastic / elasticsearch # %BRANCH% - snyk dependency monitoring" | ||
description: "Publishing of the Elasticsearch %BRANCH% dependencies graph to snyk dependency monitoring" | ||
builders: | ||
- inject: | ||
properties-file: '.ci/java-versions.properties' | ||
properties-content: | | ||
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA | ||
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA | ||
- shell: | | ||
#!/usr/local/bin/runbld --redirect-stderr | ||
set -euo pipefail | ||
set +x | ||
VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id=$VAULT_ROLE_ID secret_id=$VAULT_SECRET_ID) | ||
export VAULT_TOKEN | ||
export SNYK_TOKEN=$(vault read -field=token secret/elasticsearch-ci/snyk) | ||
unset VAULT_TOKEN | ||
set -x | ||
$WORKSPACE/.ci/scripts/run-gradle.sh uploadSnykDependencyGraph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters