Skip to content

Commit

Permalink
Update cloudbuild.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
denzuko authored Apr 4, 2022
1 parent 4c61ffb commit 1c8065f
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ steps:
snyk config set api=${_SNYK_TOKEN}
set -o pipefail
snyk test --severity-threshold=${_SEVERITY} --json | snyk-to-html -o results.html || true
- id: Validate policy compliance
name: 'openpolicyagent/conftest:latest'
args: ['test', 'main.tf', '--fail-defined']
- id: Terraform init
name: 'gcr.io/${PROJECT_ID}/terraform'
Expand All @@ -71,6 +67,21 @@ steps:
- "TF_VAR_region=${_REGION}"
- "TF_VAR_app_name=${_SERVICE_NAME}"

- id: Terraform show
name: 'gcr.io/${PROJECT_ID}/terraform'
entrypoint: '/bin/sh'
args: |
terrform show -json > tfplan.json
env:
- "TF_VAR_project-name=${PROJECT_ID}"
- "TF_VAR_image=${_IMAGE_NAME}:${_TAG}"
- "TF_VAR_region=${_REGION}"
- "TF_VAR_app_name=${_SERVICE_NAME}"

- id: Validate policy compliance
name: 'openpolicyagent/conftest:latest'
args: ['test', 'tfplan.json']

- id: Terraform apply
name: 'gcr.io/${PROJECT_ID}/terraform'
args: ['apply', '-auto-approve']
Expand Down

0 comments on commit 1c8065f

Please # to comment.