steps: # Fetch the source code - name: gcr.io/cloud-builders/git args: ['clone', 'https://github.com/stashconsulting/cloudstorage-rssfeed-python-cloudfunction.git'] # Using public terraform Docker image - name: stashconsulting/terraform-docker:entrypoint-latest args: ['init'] # Syncroning content Google Cloud Storage bucket and the Directory - name: gcr.io/cloud-builders/gsutil id: copy-result args: ['rsync', 'gs://tfstatebackup', '.'] # Create the resources using Terraform - name: stashconsulting/terraform-docker:entrypoint-latest id: terraform-apply entrypoint: 'bash' args: - '-c' - terraform apply -auto-approve -var image_id=gcr.io/$PROJECT_ID/kong_dbless:$SHORT_SHA || echo "failure" # Copy the new results back into the bucket. - name: gcr.io/cloud-builders/gsutil id: put-result args: ['cp', '-r', 'terraform.tfstate*', 'gs://tfstatebackup/']