-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
52 lines (44 loc) · 957 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
image:
name: registry.gitlab.com/gitlab-org/gitlab-build-images:terraform
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
variables:
AWS_ACCESS_KEY_ID: ${MY_AWS_ACCESS_KEY}
AWS_SECRET_ACCESS_KEY: ${MY_SECRET_KEY}
AWS_DEFAULT_REGION: <region>
before_script:
- terraform --version
- terraform init
stages:
- validate
- plan
- apply
- destroy
validate:
stage: validate
script:
- terraform validate
plan:
stage: plan
dependencies:
- validate
script:
- terraform plan -out="planfile"
artifacts:
paths:
- planfile
apply:
stage: apply
dependencies:
- plan
script:
- terraform apply --input=false "planfile"
when: manual
destroy:
stage: destroy
dependencies:
- apply
script:
- terraform destroy -auto-approve
when: manual