-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
26 lines (22 loc) · 884 Bytes
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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:https://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:https://tfstatebackup/']