forked from ahmednofal/grr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
301 lines (290 loc) · 10.7 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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
env:
global:
- GCS_BUCKET=autobuilds.grr-response.com
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
- secure: "ZE2WGDHnMX3QcLS9XNjgaC0q+Vy9mjDGdvkKd+IExUdRe8bcPNe0sLxL7G5FnkbBZQTydUpD/EDgT9dCAbBH22PfgO/J4KfM445NYVNWC3tTeZ6L2jYuVfu3xnGp6GyBGIrj8zLb1Mv1AhQL1vRwo8dsCDptY7bWH4sFnZlocDo="
matrix:
include:
# 64-bit deb builds
- os: linux
language: python
python: 2.7
addons:
apt:
packages:
- fakeroot
- debhelper
- libffi-dev
- libssl-dev
- python-dev
chrome: stable
env:
- GCS_TAG=ubuntu_64bit
- PROTOC="${HOME}/protobuf/bin/protoc"
- PATH=$PATH:${HOME}/google-cloud-sdk/bin
- BOTO_CONFIG=/dev/null # https://github.com/travis-ci/travis-ci/issues/7940
before_install:
- pip install google-compute-engine
- travis/set_up_gcs_auth.sh
- travis/install_protobuf.sh "${TRAVIS_OS_NAME}"
- pip install --upgrade virtualenv
- virtualenv "${HOME}/INSTALL"
install:
- travis/install_client_builder.sh
script:
- source "${HOME}/INSTALL/bin/activate"
- travis/build_templates.sh
- travis/deploy_to_gcs.sh
# OSX builds
- os: osx
# psutil fails to install on the default beta-xcode6.1
osx_image: xcode9.2
python: 2.7
env:
- GCS_TAG=osx
- PROTOC="${HOME}/protobuf/bin/protoc"
- PATH=$PATH:${HOME}/google-cloud-sdk/bin
before_install:
- travis/set_up_gcs_auth.sh
- travis/install_protobuf.sh "${TRAVIS_OS_NAME}"
- git clone https://github.com/MacPython/terryfy
- source terryfy/travis_tools.sh
- get_python_environment macpython 2.7.11
- pip install --upgrade virtualenv
- virtualenv "${HOME}/INSTALL"
install:
- travis/install_client_builder.sh
script:
- source "${HOME}/INSTALL/bin/activate"
- travis/build_templates.sh
- travis/deploy_to_gcs.sh
# 64-bit Centos 7 docker container inside an Ubuntu host, for rpm builds
- os: linux
dist: trusty
services:
- docker
env:
- GCS_TAG=centos_64bit
- DOCKER_IMG=grrdocker/centos7
- DOCKER_CONTAINER=centos_64bit_container
- DOCKER_USER=grrbot
- PATH=$PATH:${HOME}/google-cloud-sdk/bin
before_install:
- pip install google-compute-engine
- travis/set_up_gcs_auth.sh
# Create a Docker container which mounts the GRR repo in the
# /mnt directory
- >-
sudo docker run -dit
--volume "${PWD}:/mnt/grr"
--workdir /mnt/grr
--env DOCKER_USER="${DOCKER_USER}"
--env TRAVIS_OS_NAME="${TRAVIS_OS_NAME}"
--env PROTOC="/home/${DOCKER_USER}/protobuf/bin/protoc"
--name "${DOCKER_CONTAINER}"
"${DOCKER_IMG}"
- sudo docker exec "${DOCKER_CONTAINER}" travis/set_up_test_user.sh
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
travis/install_protobuf.sh "${TRAVIS_OS_NAME}"
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
virtualenv "/home/${DOCKER_USER}/INSTALL"
install:
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
travis/install_client_builder.sh
script:
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
travis/build_templates.sh
# Test installing the built rpm (as root)
- sudo docker exec "${DOCKER_CONTAINER}" rpm -vih gcs_upload_dir/*.rpm
- travis/deploy_to_gcs.sh
# Equivalent to the Centos job above, but builds templates that can be
# installed on Centos 6.
- os: linux
dist: trusty
services:
- docker
env:
- GCS_TAG=centos6_64bit
- DOCKER_IMG=grrdocker/centos6
- DOCKER_CONTAINER=centos6_64bit_container
- DOCKER_USER=grrbot
- PATH=$PATH:${HOME}/google-cloud-sdk/bin
before_install:
- pip install google-compute-engine
- travis/set_up_gcs_auth.sh
# Create a Docker container which mounts the GRR repo in the
# /mnt directory
- >-
sudo docker run -dit
--volume "${PWD}:/mnt/grr"
--workdir /mnt/grr
--env DOCKER_USER="${DOCKER_USER}"
--env TRAVIS_OS_NAME="${TRAVIS_OS_NAME}"
--env PROTOC="/home/${DOCKER_USER}/protobuf/bin/protoc"
--name "${DOCKER_CONTAINER}"
"${DOCKER_IMG}"
- sudo docker exec "${DOCKER_CONTAINER}" travis/set_up_test_user.sh
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
travis/install_protobuf.sh "${TRAVIS_OS_NAME}"
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
virtualenv "/home/${DOCKER_USER}/INSTALL"
install:
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
travis/install_client_builder.sh
script:
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
travis/build_templates.sh
- travis/deploy_to_gcs.sh
# 32-bit Ubuntu docker container inside a 64-bit host, for 32-bit deb builds
- os: linux
dist: trusty
services:
- docker
env:
- GCS_TAG=ubuntu_32bit
- DOCKER_IMG=grrdocker/ubuntu_i386:xenial
- DOCKER_CONTAINER=ubuntu_32bit_container
- DOCKER_USER=grrbot
- PATH=$PATH:${HOME}/google-cloud-sdk/bin
before_install:
- pip install google-compute-engine
- travis/set_up_gcs_auth.sh
# Create a Docker container which mounts the GRR repo in the
# /mnt directory
- >-
sudo docker run -dit
--volume "${PWD}:/mnt/grr"
--workdir /mnt/grr
--env DOCKER_USER="${DOCKER_USER}"
--env TRAVIS_OS_NAME="${TRAVIS_OS_NAME}"
--env PROTOC="/home/${DOCKER_USER}/protobuf/bin/protoc"
--name "${DOCKER_CONTAINER}"
"${DOCKER_IMG}"
- >-
sudo docker exec "${DOCKER_CONTAINER}"
linux32 travis/set_up_test_user.sh
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
linux32 travis/install_protobuf.sh "${TRAVIS_OS_NAME}"
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
linux32 virtualenv "/home/${DOCKER_USER}/INSTALL"
install:
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
linux32 travis/install_client_builder.sh
script:
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
linux32 travis/build_templates.sh
- travis/deploy_to_gcs.sh
# 32-bit Centos docker container inside a 64-bit host, for 32-bit rpm builds
- os: linux
dist: trusty
services:
- docker
env:
- GCS_TAG=centos_32bit
- DOCKER_IMG=grrdocker/centos_i686:7
- DOCKER_CONTAINER=centos_32bit_container
- DOCKER_USER=grrbot
- PATH=$PATH:${HOME}/google-cloud-sdk/bin
before_install:
- pip install google-compute-engine
- travis/set_up_gcs_auth.sh
# Create a Docker container which mounts the GRR repo in the
# /mnt directory
- >-
sudo docker run -dit
--volume "${PWD}:/mnt/grr"
--workdir /mnt/grr
--env DOCKER_USER="${DOCKER_USER}"
--env TRAVIS_OS_NAME="${TRAVIS_OS_NAME}"
--env PROTOC="/home/${DOCKER_USER}/protobuf/bin/protoc"
--name "${DOCKER_CONTAINER}"
"${DOCKER_IMG}"
- >-
sudo docker exec "${DOCKER_CONTAINER}"
linux32 travis/set_up_test_user.sh
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
linux32 travis/install_protobuf.sh "${TRAVIS_OS_NAME}"
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
linux32 virtualenv "/home/${DOCKER_USER}/INSTALL"
install:
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
linux32 travis/install_client_builder.sh
script:
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
linux32 travis/build_templates.sh
- travis/deploy_to_gcs.sh
# 64-bit xenial Docker container, for building server debs.
#
# Building a server deb in the trusty host did not work out so well -
# The build would fail with 'error: [Errno 11] Resource temporarily
# unavailable' after a bunch of file-copy operations. That doesn't happen
# inside the container.
- os: linux
dist: trusty
env:
- GCS_TAG=server_deb
- DOCKER_IMG=ubuntu:xenial
- DOCKER_CONTAINER=xenial_64bit_container
- DOCKER_USER=grrbot
- PATH=$PATH:${HOME}/google-cloud-sdk/bin
before_install:
- pip install google-compute-engine
- travis/set_up_gcs_auth.sh
- >-
sudo docker run -dit
--volume "${PWD}:/mnt/grr"
--workdir /mnt/grr
--env DOCKER_USER="${DOCKER_USER}"
--env TRAVIS_OS_NAME="${TRAVIS_OS_NAME}"
--env PROTOC="/home/${DOCKER_USER}/protobuf/bin/protoc"
--env TRAVIS_COMMIT="${TRAVIS_COMMIT}"
--name "${DOCKER_CONTAINER}"
"${DOCKER_IMG}"
- >-
sudo docker exec "${DOCKER_CONTAINER}" apt-get update
- >-
sudo docker exec "${DOCKER_CONTAINER}"
apt-get install -y fakeroot debhelper libffi-dev libssl-dev python-dev
python-pip wget openjdk-8-jdk zip git devscripts dh-systemd
libmysqlclient-dev dh-virtualenv dh-make libc6-i386 lib32z1
- >-
sudo docker exec "${DOCKER_CONTAINER}"
pip install --upgrade pip virtualenv
- sudo docker exec "${DOCKER_CONTAINER}" travis/set_up_test_user.sh
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
travis/install_protobuf.sh "${TRAVIS_OS_NAME}"
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
virtualenv "/home/${DOCKER_USER}/INSTALL"
install:
- >-
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
travis/install.sh
script:
- >-
travis/fetch_client_templates.sh &&
sudo docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}"
travis/build_local_pyindex.sh &&
sudo docker exec "${DOCKER_CONTAINER}"
travis/build_server_deb.sh && `# Needs to be run as root.`
travis/deploy_to_gcs.sh
cache:
directories:
- $HOME/.cache/pip