-
Notifications
You must be signed in to change notification settings - Fork 0
/
goal.yaml
55 lines (53 loc) · 1.42 KB
/
goal.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
54
55
# This example combines two `goal` features:
# 1. Environmental executions: `goal run tf-plan --on dev`
# 2. Built-in `terraform_workspace` assertions upon execution
# to prevent accidental runs on wrong environment.
#
# NOTE: Your can list available `terraform` workspaces with `terraform workspace list`
#
# Usage:
# goal run plan --on dev
# goal run plan --on stage
#
# goal run apply --on dev
# goal run apply --on stage
plan:
envs:
dev:
desc: Terraform plan on dev
assert:
- terraform_workspace: dev # Checks whether selected terraform workspace is "dev"
cmd: terraform
args:
- plan
- -var-file
- vars/dev.tfvars
stage:
desc: Terraform plan on stage
assert:
- terraform_workspace: stage # Checks whether selected terraform workspace is "stage"
cmd: terraform
args:
- plan
- -var-file
- vars/stage.tfvars
apply:
envs:
dev:
desc: Terraform apply on dev
assert:
- terraform_workspace: dev # Checks whether selected terraform workspace is "dev"
cmd: terraform
args:
- apply
- -var-file
- vars/dev.tfvars
stage:
desc: Terraform apply on stage
assert:
- terraform_workspace: stage # Checks whether selected terraform workspace is "stage"
cmd: terraform
args:
- apply
- -var-file
- vars/stage.tfvars