This repository has been archived by the owner on Jun 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
orb.yml
99 lines (98 loc) · 2.45 KB
/
orb.yml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
description: Plan, Validate & Apply Terraform
examples:
example:
description: Plan and apply terraform after validating
usage:
orbs:
terraform: sous-chefs/terraform@1
version: 2.1
workflows:
terraform:
jobs:
- terraform/fmt
- terraform/validate
- terraform/plan:
requires:
- terraform/fmt
- terraform/validate
- terraform/apply:
requires:
- terraform/plan
executors:
terraform:
description: Hashicorp image without CircleCI convenience tools installed
docker:
- image: hashicorp/terraform
jobs:
apply:
environment:
TF_WORKSPACE: <<parameters.workspace>>
executor: terraform
parameters:
folder:
default: .
description: Folder to validate
type: string
workspace:
default: default
description: Terraform workspace name
type: string
steps:
- checkout
- run:
command: terraform init -upgrade <<parameters.folder>>
name: Initialize Terraform
- run:
command: terraform validate <<parameters.folder>>
name: Validate Terraform
fmt:
executor: terraform
steps:
- checkout
- run:
command: terraform fmt -check -recursive
name: Lint Terraform
plan:
environment:
TF_WORKSPACE: <<parameters.workspace>>
executor: terraform
parameters:
folder:
default: .
description: Folder to plan
type: string
workspace:
default: default
description: Terraform workspace name
type: string
steps:
- checkout
- run:
command: terraform init -upgrade <<parameters.folder>>
name: Initialize Terraform
- run:
command: terraform plan <<parameters.folder>>
name: Plan Terraform
validate:
description: Validate terraform
environment:
TF_WORKSPACE: <<parameters.workspace>>
executor: terraform
parameters:
folder:
default: .
description: Folder to validate
type: string
workspace:
default: default
description: Terraform workspace name
type: string
steps:
- checkout
- run:
command: terraform init -upgrade <<parameters.folder>>
name: Initialize Terraform
- run:
command: terraform validate <<parameters.folder>>
name: Validate Terraform
version: 2.1