-
Notifications
You must be signed in to change notification settings - Fork 18
/
.gitlab-ci.yml
51 lines (44 loc) · 981 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
variables:
DOCKER_USERNAME: _json_key
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375
GCLOUD_SDK: gcr.io/google.com/cloudsdktool/cloud-sdk
image:
name: hashicorp/terraform:0.13.3
entrypoint:
- "/usr/bin/env"
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
stages:
- init
- validate
default:
tags:
- docker
cache: &cache
key: "${CI_COMMIT_REF_SLUG}-$CI_PROJECT_DIR-$DEPLOY_DIR"
paths:
- $CI_PROJECT_DIR/$DEPLOY_DIR/.terraform
init:
stage: init
script:
- terraform init -input=false
#------------------------------
# TERRAFORM LINT TEMPLATE
#------------------------------
validate:
stage: validate
script:
- terraform validate
cache:
<<: *cache
policy: pull
#------------------------------
# TERRAFORM LINT TEMPLATE
#------------------------------
lint:
stage: validate
script:
- terraform fmt -check -diff -write=false --recursive .
cache:
<<: *cache
policy: pull