Skip to content

Commit

Permalink
deploy: add Validate step to deploy script
Browse files Browse the repository at this point in the history
Adds two steps, CopyExisting and Validate to the vulndb deploy script,
to ensure that the existing and new databases are valid internally
and with respect to each other. Deploy will not proceed if validation
fails.

(Reinstates https://go-review.git.corp.google.com/c/vulndb/+/452771
with fix. The bug was a missing "-c" flag in CopyExisting).

For golang/go#56417

Change-Id: I0ef8e38a6679225e8b7b02a9b4b39c18a975ba9a
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/455315
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Jonathan Amsterdam <[email protected]>
Run-TryBot: Tatiana Bradley <[email protected]>
  • Loading branch information
tatianab authored and Tatiana Bradley committed Dec 6, 2022
1 parent 5b6b137 commit 65654d5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions deploy/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ steps:
entrypoint: bash
args: ["-c", "go run ./cmd/gendb -out /workspace/db"]

- id: CopyExisting
name: gcr.io/cloud-builders/gsutil
entrypoint: bash
args:
- -ec
- gsutil -q -m cp -r gs://go-vulndb /workspace

- id: Validate
name: golang:1.19.2
entrypoint: bash
args:
- -ec
- go run ./cmd/checkdeploy -new /workspace/db -existing /workspace/go-vulndb

- id: Deploy
name: gcr.io/cloud-builders/gsutil
entrypoint: bash
Expand Down

0 comments on commit 65654d5

Please sign in to comment.