forked from cloud-ca/cloudca-rke-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
58 lines (50 loc) · 1.05 KB
/
.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
56
57
58
image:
name: hashicorp/terraform:0.12.4
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
stages:
- validate
- plan
- deploy
variables:
PLAN: terraform.tfplan
cache:
paths:
- .terraform
before_script:
- apk add --update make curl
- |
curl -sL https://github.com/cloud-ca/terraform-provider-cloudca/releases/download/v1.5.0/terraform-provider-cloudca_v1.5.0_linux-amd64.zip > terraform-provider-cloudca.zip && \
mkdir -p ~/.terraform.d/plugins && \
unzip -q terraform-provider-cloudca.zip -d ~/.terraform.d/plugins && \
rm terraform-provider-cloudca.zip
- terraform --version
- make init
validate:
stage: validate
script:
- make validate
checkfmt:
stage: validate
script:
- make checkfmt
plan:
stage: plan
script:
- TFPLAN=$PLAN make plan
artifacts:
name: plan
paths:
- $PLAN
apply:
stage: deploy
environment:
name: prod
script:
- TFPLAN=$PLAN make apply
dependencies:
- plan
when: manual
only:
- master