This repository was archived by the owner on Aug 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
58 lines (53 loc) · 1.61 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:light
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
before_script:
- find /root
- rm -rf .terraform
- mkdir ~/.terraform
- mount | grep noexec
- terraform --version
- mkdir -p ~/.terraform.d/plugins
- curl -L https://github.com/gig-tech/terraform-provider-ovc/releases/download/v0.0.1/terraform-provider-ovc_v0.0.1-linux -o ~/.terraform.d/plugins/terraform-provider-ovc
- curl -L https://github.com/nbering/terraform-provider-ansible/releases/download/v0.0.4/terraform-provider-ansible-linux_amd64.zip -o terraform-provider-ansible-linux_amd64.zip && unzip terraform-provider-ansible-linux_amd64.zip
- mv linux_amd64/terraform-provider-ansible_v0.0.4 ~/.terraform.d/plugins/terraform-provider-ansible
- chmod a+x ~/.terraform.d/plugins/*
- chmod a+x ~/
- ls -l ~/.terraform.d/plugins/*
- ls -l /root/.terraform.d/plugins
- ls -dl /root
- ls -dl /root/.terraform.d
- ls -dl /root/.terraform.d/plugins
- mkdir -p ./creds
- echo $SERVICEACCOUNT | base64 -d > ./creds/serviceaccount.json
- cd terraform
- id
- ls -l /root/.terraform.d/plugins/terraform-provider-ovc
- ls -l /root/.terraform.d/plugins/terraform-provider-ansible
- terraform init
stages:
- validate
- plan
- apply
validate:
stage: validate
script:
- terraform validate
plan:
stage: plan
script:
- terraform plan -out "planfile"
dependencies:
- validate
artifacts:
paths:
- planfile
apply:
stage: apply
script:
- terraform apply -input=false "planfile"
dependencies:
- plan
when: manual