-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
36 lines (33 loc) · 794 Bytes
/
.gitlab-ci.yml
File metadata and controls
36 lines (33 loc) · 794 Bytes
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
cache:
key: tofu
paths:
- .terraform/
- .terraform.lock.hcl
- tfplan
stages:
# - infra-destroy
- infra-plan
- infra-apply
# destroy infra:
# stage: infra-destroy
# script:
# - tofu init
# - tofu refresh -var="pm_api_token_secret=$PM_API_TOKEN_SECRET"
# - tofu destroy -auto-approve -var="pm_api_token_secret=$PM_API_TOKEN_SECRET"
plan infra:
stage: infra-plan
script:
- tofu init -upgrade
- tofu validate
- tofu plan -var="pm_api_token_secret=$PM_API_TOKEN_SECRET" -out=tfplan
- tofu show -no-color tfplan > tfplan.txt
artifacts:
paths:
- tfplan.txt
apply infra:
stage: infra-apply
script:
- tofu apply -var="pm_api_token_secret=$PM_API_TOKEN_SECRET" -auto-approve
dependencies:
- plan infra
when: manual