-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
76 lines (69 loc) · 1.84 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
stages:
- deploy
.deploy_job:
image: willhallonline/ansible:2.16.4-alpine-3.19
stage: deploy
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | base64 -d | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- ansible-playbook -v -i ${INVENTORY_FILE} prerequisites.yml
- ansible-playbook -v -i ${INVENTORY_FILE} ${PLAYBOOK} --extra-vars @default-setup/default-config.yml --extra-vars "@${CONFIG_FILE}"
#scheduled deploy to Develop:
# variables:
# CONFIG_FILE: config_DEV.yml
# INVENTORY_FILE: inventory_DEV.yml
# PLAYBOOK: search_index.setup.system
# extends: .deploy_job
# only:
# - schedules
deploy to Develop:
variables:
CONFIG_FILE: config_DEV.yml
INVENTORY_FILE: inventory_DEV.yml
PLAYBOOK: search_index.setup.system
extends: .deploy_job
only:
- master
when: manual
Develop Backend Deployment:
variables:
CONFIG_FILE: config_DEV.yml
INVENTORY_FILE: inventory_DEV.yml
PLAYBOOK: search_index.setup.backend
extends: .deploy_job
only:
- master
when: manual
Develop ETL Deployment:
variables:
CONFIG_FILE: config_DEV.yml
INVENTORY_FILE: inventory_DEV.yml
PLAYBOOK: search_index.setup.etl
extends: .deploy_job
only:
- master
when: manual
Develop Frontend Deployment:
variables:
CONFIG_FILE: config_DEV.yml
INVENTORY_FILE: inventory_DEV.yml
PLAYBOOK: search_index.setup.frontend
extends: .deploy_job
only:
- master
when: manual
deploy to Test:
variables:
CONFIG_FILE: config_TEST.yml
INVENTORY_FILE: inventory_TEST.yml
PLAYBOOK: search_index.setup.system
extends: .deploy_job
only:
- master
when: manual