-
Notifications
You must be signed in to change notification settings - Fork 36
/
.travis.yml
252 lines (220 loc) · 9.16 KB
/
.travis.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# .travis.yml
---
sudo: required
env:
global:
- container_id=$(mktemp)
matrix:
# 1 proxy server
- >
JOB_NAME="Proxy Server"
PRE_CMD=""
PARENT_GROUP=all
HOST_GROUP=proxy_server
PLAYBOOK_LOCATION=/aurora/deploy/deploy_proxy_server.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "install_python": false, "kerberos_enabled": false, "use_epel": false}'
# 2 admin terminal
- >
JOB_NAME="Admin Terminal"
PRE_CMD=""
PARENT_GROUP=all
HOST_GROUP=admin_terminal
PLAYBOOK_LOCATION=/aurora/deploy/deploy_admin_terminal.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "install_python": false}'
# 3 development_terminal
- >
JOB_NAME="Development Terminal"
PRE_CMD="travis_wait 50"
PARENT_GROUP=all
HOST_GROUP=analytics_terminal
PLAYBOOK_LOCATION=/aurora/deploy/deploy_development_terminal.yml
EXTRA_VAR_DEF='{"install_python": false, "install_ruby": false, "deploy_iptables": false}'
# 4 r_terminal
- >
JOB_NAME="R terminal"
PRE_CMD="travis_wait 50"
PARENT_GROUP=all
HOST_GROUP=analytics_terminal
PLAYBOOK_LOCATION=/aurora/deploy/deploy_r_terminal.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "install_r_updates": false, "deploy_iptables": false, "install_r_packages": false, "ip_whitelist": []}'
# 5 elastic search
- >
JOB_NAME="Elastic Search"
PRE_CMD=""
PARENT_GROUP=all
HOST_GROUP=elasticsearch
PLAYBOOK_LOCATION=/aurora/deploy/deploy_elastic_search.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "install_python": false}'
# 6 elk
- >
JOB_NAME="ELK"
PRE_CMD=""
PARENT_GROUP=all
HOST_GROUP=elk
PLAYBOOK_LOCATION=/aurora/deploy/deploy_elk.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "install_python": false, "deploy_iptables": false}'
# 7 mesos
- >
JOB_NAME="Mesos Agent"
PRE_CMD="travis_wait 50"
PARENT_GROUP=all
HOST_GROUP=mesos_agent
PLAYBOOK_LOCATION=/aurora/deploy/deploy_mesos_agent.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "install_python": false, "install_ruby": false, "install_r_updates": false, "install_sqitch": false, "install_r_packages": false, "deploy_iptables": false}'
# 8 mesos_master
- >
JOB_NAME="Mesos Master"
PRE_CMD=""
PARENT_GROUP=all
HOST_GROUP=mesos_master
PLAYBOOK_LOCATION=/aurora/deploy/deploy_mesos_master.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "deploy_iptables": false, "zookeeper_id": 1}'
# 9 gocd ci_server
- >
JOB_NAME="GoCD CI Server"
PRE_CMD=""
PARENT_GROUP=all
HOST_GROUP=ci_server
PLAYBOOK_LOCATION=/aurora/deploy/deploy_gocd.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "deploy_iptables": false, "install_python": false, "restart_gocd_server": false}'
# 10 gocd ci_agent
- >
JOB_NAME="GoCD CI Agent"
PRE_CMD=""
PARENT_GROUP=all
HOST_GROUP=ci_agent
PLAYBOOK_LOCATION=/aurora/deploy/deploy_gocd.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "install_python": false, "mesos_master": false, "install_ruby": false, "install_r_updates": false, "install_sqitch": false, "install_r_packages": false, "deploy_iptables": false}'
# 11 gocd ci_terminal
- >
JOB_NAME="GoCD CI Terminal"
PRE_CMD="travis_wait 50"
PARENT_GROUP=all
HOST_GROUP=ci_terminal
PLAYBOOK_LOCATION=/aurora/deploy/deploy_gocd.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "install_python": false, "mesos_master": false, "install_ruby": false, "install_r_updates": false, "install_sqitch": false, "install_r_packages": false, "deploy_iptables": false, "install_talend": false, "install_pentaho": false, "ip_whitelist": []}'
# 12 Research Server research_ancillary_services
- >
JOB_NAME="Research Ancillary Services"
PRE_CMD=""
PARENT_GROUP=research_environment
HOST_GROUP=research_ancillary_services
PLAYBOOK_LOCATION=/aurora/deploy/deploy_research_environment.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "deploy_iptables": false}'
# 13 Research Server research_eod
- >
JOB_NAME="Research EOD"
PRE_CMD=""
PARENT_GROUP=research_environment
HOST_GROUP=research_eod
PLAYBOOK_LOCATION=/aurora/deploy/deploy_research_environment.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "deploy_iptables": false}'
# 14 Research Server research_gauss - use this to test changing handlers for timeout issue
- >
JOB_NAME="Research Gauss"
PRE_CMD="travis_wait 50"
PARENT_GROUP=research_environment
HOST_GROUP=research_gauss
PLAYBOOK_LOCATION=/aurora/deploy/deploy_research_environment.yml
EXTRA_VAR_DEF='{"install_python": false, "restart_gocd_server": false, "skip_glusterfs": true, "deploy_iptables": false}'
# 15 Research Server research_stata
- >
JOB_NAME="Research Stata"
PRE_CMD="travis_wait 50"
PARENT_GROUP=research_environment
HOST_GROUP=research_stata
PLAYBOOK_LOCATION=/aurora/deploy/deploy_research_environment.yml
EXTRA_VAR_DEF='{"skip_glusterfs": true, "deploy_iptables": false}'
# 16 Research Server research_python
- >
JOB_NAME="Research Python"
PRE_CMD="travis_wait 50"
PARENT_GROUP=research_environment
HOST_GROUP=research_python
PLAYBOOK_LOCATION=/aurora/deploy/deploy_research_environment.yml
EXTRA_VAR_DEF='{"install_python": false, "install_r_packages": false, "install_r_updates": false, "skip_glusterfs": true, "deploy_iptables": false}'
# 17 Research Server research_sas
- >
JOB_NAME="Research SAS"
PRE_CMD="travis_wait 50"
PARENT_GROUP=research_environment
HOST_GROUP=research_sas
PLAYBOOK_LOCATION=/aurora/deploy/deploy_research_environment.yml
EXTRA_VAR_DEF='{"install_python": false, "restart_gocd_server": false, "skip_glusterfs": true, "deploy_iptables": false}'
# 18 Research Server research_spss
- >
JOB_NAME="Research SPSS"
PRE_CMD=""
PARENT_GROUP=research_environment
HOST_GROUP=research_spss
PLAYBOOK_LOCATION=/aurora/deploy/deploy_research_environment.yml
EXTRA_VAR_DEF='{"install_python": false, "restart_gocd_server": false, "skip_glusterfs": true, "deploy_iptables": false}'
# 19 Research Server research_matlab
- >
JOB_NAME="Research Matlab"
PRE_CMD=""
PARENT_GROUP=research_environment
HOST_GROUP=research_matlab
PLAYBOOK_LOCATION=/aurora/deploy/deploy_research_environment.yml
EXTRA_VAR_DEF='{"install_python": false, "restart_gocd_server": false, "skip_glusterfs": true, "deploy_iptables": false}'
# 20 Data warehouse db_terminal
- >
JOB_NAME="Data warehouse db_terminal"
PRE_CMD=""
PARENT_GROUP=all
HOST_GROUP=db_terminal
PLAYBOOK_LOCATION=/aurora/deploy/deploy_db_terminal.yml
EXTRA_VAR_DEF='{"install_python": false, "deploy_iptables": false, "install_sqitch": false, "install_pem": false, "skip_glusterfs": true}'
# 21 Data warehouse db_server
- >
JOB_NAME="Data warehouse db_server"
PRE_CMD=""
PARENT_GROUP=all
HOST_GROUP=db_server
PLAYBOOK_LOCATION=/aurora/deploy/deploy_db_server.yml
EXTRA_VAR_DEF='{"deploy_iptables": false, "pp_install": true, "skip_glusterfs": true}'
# 22 Citus Coordinator (does not include the standby and workers)
- >
JOB_NAME="Citus Coordinator"
CENTOS_VERSION="7"
PRE_CMD=""
PARENT_GROUP=citus
HOST_GROUP=citus_coordinator
PLAYBOOK_LOCATION=/aurora/deploy/deploy_citus_server.yml
EXTRA_VAR_DEF='{"deploy_iptables": false, "pp_install": true, "skip_glusterfs": true, "pp_shared_preload_libraries": "citus"}'
services:
- docker
language: python
python:
- "2.7"
before_install:
- sudo apt-get update
# Pull container
- docker pull centos:${CENTOS_VERSION:-6}
# Customize container
# Default is CentOS 6.x, which uses Dockerfile and tag centos:ansible.
# If CENTOS_VERSION is set to "7", we use Dockerfile7 and tag centos7:ansible.
- docker build --rm=true --file=Dockerfile${CENTOS_VERSION} --tag=centos${CENTOS_VERSION}:ansible . #replace with variable later
#May need to clean up, killed docker instances: docker rm -v $(docker ps -a -q -f status=exited)
script:
# Run container in detached state
- >
docker run --detach --volume="${PWD}":/aurora:ro --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro centos${CENTOS_VERSION}:ansible "/sbin/init" > "${container_id}"
- >
docker exec "$(cat ${container_id})" env TERM=xterm sh -c "echo $EXTRA_VAR_DEF > /tmp/extra_vars.json"
- >
docker exec --tty "$(cat ${container_id})" env TERM=xterm sh -c "cat /tmp/extra_vars.json"
# Parameterize docker temp file build
- >
docker exec --tty "$(cat ${container_id})" env TERM=xterm sh -c "echo -e \"[${PARENT_GROUP}:children]\\n${HOST_GROUP}\\n[${HOST_GROUP}]\\nlocalhost ansible_ssh_host=127.0.0.1 ansible_connection=local\" > /etc/ansible/hosts"
# Syntax check
- >
docker exec "$(cat ${container_id})" env TERM=xterm ANSIBLE_FORCE_COLOR=1 ansible-playbook --syntax-check "${PLAYBOOK_LOCATION}" --extra-vars "@/tmp/extra_vars.json"
# Test role
- >
${PRE_CMD} docker exec "$(cat ${container_id})" env TERM=xterm ANSIBLE_FORCE_COLOR=1 ansible-playbook -vv "${PLAYBOOK_LOCATION}" --skip-tags='skip-travis' --extra-vars "@/tmp/extra_vars.json"
# extra log info
#- >
# docker exec "$(cat ${container_id})" env TERM=xterm ANSIBLE_FORCE_COLOR=1 ansible-playbook -vvvv "${PLAYBOOK_LOCATION}" --extra-vars "@/tmp/extra_vars.json"
# Clean up
- docker stop "$(cat ${container_id})"