-
Notifications
You must be signed in to change notification settings - Fork 3
/
gitlab-ci.yml
53 lines (45 loc) · 921 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
include:
- template: Terraform/Base.gitlab-ci.yml
variables:
TF_STATE_NAME: clusterstate
TF_CACHE_KEY: cluster
stages:
- init
- validate
- plan
- deploy
init:
before_script:
- cd ~/
- rm -r -f {gitlab_project_folder}
- git clone http://oauth2:${INFRA_ACCESS_TOKEN}@{gitlab_project_url}.git
- cd {gitlab_project_folder}
extends: .init
script:
- make proxmox-tf-init
validate:
before_script:
- cd ~/{gitlab_project_folder}
extends: .validate
needs:
- job: init
script:
- make proxmox-tf-validate
plan:
before_script:
- cd ~/{gitlab_project_folder}
extends: .plan
needs: [validate, init]
script:
- make proxmox-tf-plan
deploy:
before_script:
- cd ~/{gitlab_project_folder}
extends: .deploy
needs: [plan]
script:
- make proxmox-tf-apply-gitlab
when: manual
after_script:
- cd ~/
- rm -r {gitlab_project_folder}