-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloudbuild.yaml
53 lines (50 loc) · 1.1 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
52
53
steps:
- id: tf init
name: hashicorp/terraform:0.12.24
dir: ./src/infrastructure
entrypoint: sh
args:
- -c
- |
echo ""
echo "[INIT]"
terraform init
- id: tf plan
name: hashicorp/terraform:0.12.24
dir: ./src/infrastructure
entrypoint: sh
args:
- -c
- |
echo ""
echo "[PLAN]"
terraform plan
- id: tf apply
name: hashicorp/terraform:0.12.24
dir: ./src/infrastructure
entrypoint: sh
args:
- -c
- |
echo ""
echo "[APPLY]"
if [ -n "$_BASE_BRANCH" ]; then
echo 'Skip. This is a Pull Request.'
else
terraform apply -auto-approve
fi
- id: apply manifests
name: gcr.io/cloud-builders/gcloud
dir: ./src/manifests
entrypoint: sh
args:
- -c
- |
echo ""
echo "[APPLY MANIFESTS]"
if [ -n "$_BASE_BRANCH" ]; then
echo 'Skip. This is a Pull Request.'
else
gcloud builds submit . --config=./cloudbuild.yaml
fi
timeout: 1800s