From 036f4060c4da96668fc7b18cd52fe79698f4ee5e Mon Sep 17 00:00:00 2001 From: Mark Chmarny Date: Sat, 6 May 2023 17:37:49 -0700 Subject: [PATCH] add target env var --- .version | 2 +- cloud/gcp/process.yaml | 11 ++++------- internal/cmd/flag.go | 1 + 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.version b/.version index e07d136c..45a99704 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -v0.6.0 \ No newline at end of file +v0.6.1 \ No newline at end of file diff --git a/cloud/gcp/process.yaml b/cloud/gcp/process.yaml index 5de26eec..d35886db 100644 --- a/cloud/gcp/process.yaml +++ b/cloud/gcp/process.yaml @@ -10,13 +10,12 @@ steps: wait_for: - scan-grype secretEnv: - - _DB_CONN_STR + - VIMP_TARGET args: - --debug - import - --source=${_DIGEST} - --file=./grype.json - - --target=${_DB_CONN_STR} # trivy - id: scan-trivy @@ -28,13 +27,12 @@ steps: wait_for: - scan-trivy secretEnv: - - _DB_CONN_STR + - VIMP_TARGET args: - --debug - import - --source=${_DIGEST} - --file=./trivy.json - - --target=${_DB_CONN_STR} # snyk # NOTE: snyk exit with 1 if vulnerabilities are found @@ -52,20 +50,19 @@ steps: wait_for: - scan-snyk secretEnv: - - _DB_CONN_STR + - VIMP_TARGET args: - --debug - import - --source=${_DIGEST} - --file=./snyk.json - - --target=${_DB_CONN_STR} availableSecrets: secretManager: - versionName: projects/$PROJECT_NUMBER/secrets/snyk-token/versions/1 env: 'SNYK_TOKEN' - versionName: projects/$PROJECT_NUMBER/secrets/db-conn-str/versions/1 - env: '_DB_CONN_STR' + env: 'VIMP_TARGET' options: pool: diff --git a/internal/cmd/flag.go b/internal/cmd/flag.go index f3b9d339..80998c7b 100644 --- a/internal/cmd/flag.go +++ b/internal/cmd/flag.go @@ -31,6 +31,7 @@ var ( targetFlag = &c.StringFlag{ Name: "target", Aliases: []string{"t"}, + EnvVars: []string{"VIMP_TARGET"}, Usage: fmt.Sprintf("target (e.g. %s, etc.)", strings.Join(target.GetSampleTargets(), ", ")), }