-
Notifications
You must be signed in to change notification settings - Fork 7
/
cloudbuild.yaml
51 lines (48 loc) · 1.14 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
steps:
- id: 'project Init'
name: gcr.io/cloud-builders/gcloud
entrypoint: sh
args:
- '-c'
- |
echo "***********************"
echo "project : $PROJECT_ID"
echo "branch : $BRANCH_NAME"
echo "default_region : ${_DEFAULT_REGION}"
echo "***********************"
cd iac/init
chmod +x init.sh
./init.sh ${PROJECT_ID}
# [START tf-init]
- id: 'Layer Data Ingestion - terraform init'
name: 'hashicorp/terraform:1.2.1'
entrypoint: 'sh'
args:
- '-c'
- |
cd iac
terraform init -input=false -no-color -upgrade -backend-config=init/backend.tfvars
# [END tf-init]
# [START tf-plan]
- id: 'Terraform plan'
name: 'hashicorp/terraform:1.2.1'
entrypoint: 'sh'
args:
- '-c'
- |
cd iac
terraform plan -out changes.tfplan -var project_id=$PROJECT_ID
# [END tf-plan]
# [START tf-apply]
- id: 'Layer Data Ingestion - terraform apply'
name: 'hashicorp/terraform:1.2.1'
entrypoint: 'sh'
args:
- '-c'
- |
cd iac
terraform apply -input=false -no-color -auto-approve changes.tfplan
# [END tf-apply]
timeout: 5400s
options:
logging: CLOUD_LOGGING_ONLY