Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added trigger for Google Cloud Build #36

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
47 changes: 47 additions & 0 deletions GoogleCloudBuild/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
steps:
- name: 'snyk/snyk-cli:npm'
jiajunngjj marked this conversation as resolved.
Show resolved Hide resolved
args:
- '-c'
jiajunngjj marked this conversation as resolved.
Show resolved Hide resolved
- |-
snyk config set api=${_SNYK_TOKEN}
Copy link
Collaborator

Choose a reason for hiding this comment

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

does google cloud build support "before" directives, so that this command is only written once in this file?

Choose a reason for hiding this comment

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

A YAML anchor would also help to make this DRYer: https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/

snyk test --severity-threshold=medium || true
id: Snyk Open Source test
jiajunngjj marked this conversation as resolved.
Show resolved Hide resolved
entrypoint: bash
- name: 'snyk/snyk-cli:npm'
args:
- '-c'
- |-
snyk config set api=${_SNYK_TOKEN}
snyk code test --severity-threshold=medium || true
id: Snyk Code test
entrypoint: bash
- name: 'snyk/snyk-cli:npm'
args:
- '-c'
- |-
snyk config set api=${_SNYK_TOKEN}
snyk iac test <TERRAFORM FILE> || true
id: Snyk IaC test
entrypoint: bash
- name: 'snyk/snyk-cli:npm'
args:
- '-c'
- |-
snyk config set api=${_SNYK_TOKEN}
snyk container test --severity-threshold=medium <CONTAINER_IMAGE> || true
id: Snyk Container test
entrypoint: bash
- name: 'snyk/snyk-cli:npm'
args:
- '-c'
- |-
snyk config set api=${_SNYK_TOKEN}
snyk test --severity-threshold=medium --json | snyk-to-html -o
results.html || true
id: Create HTML artefact
entrypoint: bash
artifacts:
objects:
location: 'gs://<STORE_NAME>/scan_output'
paths:
- results.html