-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
55 lines (47 loc) · 1003 Bytes
/
.gitlab-ci.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
default:
image: registry.gitlab.com/gitlab-org/terraform-images/stable:latest
cache:
key: kjdev-prod
paths:
- ${TF_ROOT}/.terraform
variables:
TF_ROOT: ${CI_PROJECT_DIR}
CONSUL_HTTP_TOKEN: ${CONSUL_HTTP_TOKEN}
VAULT_TOKEN: ${VAULT_TOKEN}
VAULT_ADDR: 'http://10.1.1.13:8100'
TF_ADDRESS: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/kjdev-prod
before_script:
- cd ${TF_ROOT}
stages:
- prepare
- validate
init:
stage: prepare
script:
- gitlab-terraform init
validate:
stage: validate
script:
- gitlab-terraform validate
# plan:
# stage: build
# script:
# - gitlab-terraform plan
# - gitlab-terraform plan-json
# artifacts:
# name: plan
# paths:
# - ${TF_ROOT}/plan.cache
# reports:
# terraform: ${TF_ROOT}/plan.json
# apply:
# stage: deploy
# environment:
# name: production
# script:
# - gitlab-terraform apply
# dependencies:
# - plan
# when: manual
# only:
# - main