This repository has been archived by the owner on Aug 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Yaybufile
571 lines (475 loc) · 18.1 KB
/
Yaybufile
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
yaybu:
searchpath:
- .
secrets:
assets_access_key: DUMMY
assets_secret_key: DUMMY
master:
resources:
- Group:
name: rb_master
- User:
name: rb_master
group: rb_master
- Directory:
name: /var/local/releasebot/master
owner: rb_master
group: rb_master
- Execute:
name: rb-master-create-virtualenv
user: rb_master
commands:
- curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.10.1.tar.gz
- tar xvfz virtualenv-1.10.1.tar.gz
- python virtualenv-1.10.1/virtualenv.py /var/local/releasebot/master
- rm -rf virtualenv-1.10.1
creates: /var/local/releasebot/master/bin/python
cwd: /tmp
- File:
name: /var/local/releasebot/master/requirements.txt
source: master/requirements.txt
- Execute:
name: rb-master-pip-install
command: /var/local/releasebot/master/bin/pip install -r /var/local/releasebot/master/requirements.txt
user: rb_master
policy:
execute:
- when: apply
on: File[/var/local/releasebot/master/requirements.txt]
#FIXME: The console is 0.8.8 isn't multi-code-base aware
# This bumps it to ed8d49e2176a4f299a88805dced3b6fdb4c3c1d9
# This has a few multi-code patches applied
- File:
name: /var/local/releasebot/master/lib/python2.7/site-packages/buildbot/status/web/console.py
source: master/console.py
owner: rb_master
- Directory:
name: /var/local/releasebot/master/instance
owner: rb_master
group: rb_master
- Execute:
name: create-buildmaster
command: /var/local/releasebot/master/bin/buildbot create-master /var/local/releasebot/master/instance
creates: /var/local/releasebot/master/instance/buildbot.tac
user: rb_master
- File:
name: /var/local/releasebot/master/instance/master.cfg
source: master/master.cfg
- Directory:
name: /var/local/releasebot/master/etc
- File:
name: /var/local/releasebot/master/etc/settings.json
renderer: json
args:
debs:
root: {{ builder_deb.root }}
archives: {{ builder_deb.archives }}
- Execute:
name: buildbot-check
command: /var/local/releasebot/master/bin/buildbot checkconfig /var/local/releasebot/master/instance
user: rb_master
policy:
execute:
- when: execute
on: Execute[rb-master-pip-install]
- when: apply
on: File[/var/local/releasebot/master/instance/master.cfg]
- when: apply
on: File[/var/local/releasebot/master/etc/settings.json]
- Execute:
name: buildbot-upgrade
commands:
- sh -c "stop rb_master | true"
- sudo -u rb_master /var/local/releasebot/master/bin/buildbot upgrade-master /var/local/releasebot/master/instance
policy:
execute:
- when: execute
on: Execute[rb-master-pip-install]
- File:
name: /etc/init/rb_master.conf
source: master/upstart.conf
- Execute:
name: rb-master-bounce
commands:
- sh -c "stop rb_master || true"
- start rb_master
policy:
execute:
- when: execute
on: Execute[rb-master-pip-install]
- when: apply
on: File[/var/local/releasebot/master/instance/master.cfg]
- when: apply
on: File[/var/local/releasebot/master/etc/settings.json]
- when: apply
on: File[/etc/init/rb_master.conf]
macro BuildbotSlave:
- Group:
name: rb_{{ name }}
- User:
name: rb_{{ name }}
group: rb_{{ name }}
home: /var/local/releasebot/{{ name }}
- Directory:
name: /var/local/releasebot/{{ name }}
owner: rb_{{ name }}
group: rb_{{ name }}
- Execute:
name: rb-{{ name }}-create-virtualenv
user: rb_{{ name }}
commands:
- curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.10.1.tar.gz
- tar xvfz virtualenv-1.10.1.tar.gz
- python virtualenv-1.10.1/virtualenv.py /var/local/releasebot/{{ name }}
- rm -rf virtualenv-1.10.1
creates: /var/local/releasebot/{{ name }}/bin/python
cwd: /var/local/releasebot/{{ name }}
- File:
name: /var/local/releasebot/{{ name }}/requirements.txt
source: slave/requirements.txt
# args: {{ extra_requirements or {} }}
- Execute:
name: rb-{{ name }}-pip-install
command: /var/local/releasebot/{{ name }}/bin/pip install -r /var/local/releasebot/{{ name }}/requirements.txt
user: rb_{{ name }}
policy:
execute:
- when: apply
on: File[/var/local/releasebot/{{ name }}/requirements.txt]
- File:
name: /var/local/releasebot/{{ name }}/bin/attach_to_release
source: slave/attach_to_release
args:
root: /var/local/releasebot/{{ name }}
mode: 0755
- Directory:
name: /var/local/releasebot/{{ name }}/instance
owner: rb_{{ name }}
group: rb_{{ name }}
- Execute:
name: rb-{{ name }}-create-buildslave
command: /var/local/releasebot/{{ name }}/bin/buildslave create-slave -r /var/local/releasebot/{{ name }}/instance localhost:9989 {{ name }} {{ password }}
creates: /var/local/releasebot/{{ name }}/instance/buildbot.tac
user: rb_{{ name }}
- File:
name: /etc/init/rb_{{ name }}.conf
source: slave/upstart.conf
args:
uid: rb_{{ name }}
gid: rb_{{ name }}
name: {{ name }}
- Execute:
name: rb-{{ name }}-bounce
commands:
- sh -c "stop rb_{{ name }} || true"
- start rb_{{ name }}
policy:
execute:
- when: execute
on: Execute[rb-{{ name }}-pip-install]
- when: apply
on: File[/etc/init/rb_{{ name }}.conf]
- File:
name: /var/local/releasebot/{{ name }}/.s3cmd.cfg
source: slave/s3cmd.cfg
args:
access_key: {{ secrets.assets_access_key }}
secret_key: {{ secrets.assets_secret_key }}
owner: rb_{{ name }}
group: rb_{{ name }}
mode: 0600
builder_deb:
root: /var/local/releasebot/debian
archives:
- name: raspbian
root: /var/local/releasebot/debian/archives/raspbian
mirror: http://mirror.netcologne.de/raspbian/raspbian/
components:
- main
series:
- name: stable
archs:
- armhf
- name: ubuntu
mirror: http://mirrors.kernel.org/ubuntu/
root: /var/local/releasebot/debian/archives/ubuntu
components:
- main
- restricted
- universe
- multiverse
series:
- name: lucid
archs:
- i386
- amd64
- name: precise
archs:
- i386
- amd64
- name: debian
mirror: http://ftp.us.debian.org/debian/
root: /var/local/releasebot/debian/archives/debian
components:
- main
- contrib
- non-free
series: []
resources:
call BuildbotSlave:
name: debian
password: pass
- Package:
- name: pbuilder
- name: qemu-user-static
- name: reprepro
- File:
name: /etc/sudoers.d/rb_debian_pdebuild
source: builder_debian/sudoers
mode: 0440
# Set up some reprepro repositories
- Directory:
name: /var/local/releasebot/debian/archives
owner: rb_debian
for archive in builder_deb.archives:
set root_dir = "/var/local/releasebot/debian/archives/" + archive.name
- Directory:
name: {{ root_dir }}
owner: rb_debian
for n in ["conf", "incoming", "log", "tmp"]:
- Directory:
name: {{ root_dir }}/{{ n }}
owner: rb_debian
- File:
name: {{ root_dir }}/conf/distributions
source: builder_debian/distributions
args:
archive: {{ archive }}
mode: 0755
- File:
name: {{ root_dir }}/conf/incoming
source: builder_debian/incoming
args:
root_dir: {{ root_dir }}
archive: {{ archive }}
mode: 0755
# Setup some pbuilder environments
- Directory:
name: /var/local/releasebot/debian/pbuilder
owner: rb_debian
for archive in builder_deb.archives:
for series in archive.series:
for arch in series.archs:
set root_dir = "/var/local/releasebot/debian/pbuilder/" + archive.name + "-" + series.name + "-" + arch
- Directory:
name: {{ root_dir }}
owner: rb_debian
for n in ["result", "aptcache", "build", "hooks", "wheels", "sdists"]:
- Directory:
name: {{ root_dir }}/{{ n }}
owner: rb_debian
- File:
name: {{ root_dir }}/config
source: builder_debian/pbuilderrc
args:
root_dir: {{ root_dir }}
archive: {{ archive }}
series: {{ series }}
arch: {{ arch }}
src_dir: /var/local/releasebot/debian/instance/{{ archive.name }}_{{ series.name }}_{{ arch }}/build
- File:
name: {{ root_dir }}/hooks/A05install_dh_virtualenv
source: builder_debian/A05install_dh_virtualenv
args:
root_dir: {{ root_dir }}
mode: 0755
- File:
name: {{ root_dir }}/hooks/B52test_pkg
source: builder_debian/B52test_pkg
mode: 0755
- File:
name: {{ root_dir }}/hooks/D00clean
source: builder_debian/D00clean
mode: 0755
- File:
name: {{ root_dir }}/hooks/F10apt-get-update
source: builder_debian/D10apt-get-update
mode: 0755
- Execute:
name: pbuilder-create-{{ archive.name }}-{{ series.name }}-{{ arch }}
command: pbuilder --create --configfile {{ root_dir }}/config
creates: {{ root_dir }}/base.tgz
builder_wine:
user: rb_wine
c_drive: /var/local/releasebot/wine/.wine/drive_c
home: /var/local/releasebot/wine/.wine/drive_c/users/rb_wine
wheels: /var/local/releasebot/wine/.wine/drive_c/wheels
sdists: /var/local/releasebot/wine/.wine/drive_c/sdists
src: /var/local/releasebot/wine/src
wineprefix: /var/local/releasebot/wine/.wine
resources:
call BuildbotSlave:
name: wine
password: pass
- Package:
- name: python-software-properties
- name: debconf-utils
- name: zip
- Execute:
name: add-apt-repository-ubuntu-wine
commands:
- add-apt-repository -y ppa:ubuntu-wine/ppa
- apt-get update
creates: /etc/apt/sources.list.d/ubuntu-wine-ppa-precise.list
- Execute:
name: debconf/msttcorefonts/accepted-mscorefonts-urla
command: sh -c "echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections"
unless: debconf-get-selections | grep accepted-mscorefonts-eula | grep true
- Package:
- name: wine1.6
- name: xvfb
- name: p7zip-full
- Directory:
name: {{ builder_wine.src }}
owner: {{ builder_wine.user }}
- Directory:
name: {{ builder_wine.wineprefix }}
owner: {{ builder_wine.user }}
- Directory:
name: {{ builder_wine.wineprefix }}/drive_c
owner: {{ builder_wine.user }}
- Directory:
name: {{ builder_wine.wheels }}
owner: {{ builder_wine.user }}
- Directory:
name: {{ builder_wine.sdists }}
owner: {{ builder_wine.user }}
- Execute:
name: download-python27
command: curl -o {{ builder_wine.src }}/python-2.7.6.msi http://legacy.python.org/ftp//python/2.7.6/python-2.7.6.msi
creates: {{ builder_wine.src }}/python-2.7.6.msi
user: {{ builder_wine.user }}
# If this stops working, check to see if the download is valid
# If a new python release is made you might end up downloading a 302 redirect..
- Execute:
name: install-python
command: wine msiexec /i {{ builder_wine.src }}/python-2.7.6.msi /qn TARGETDIR=C:\\Python27 ALLUSERS=1
creates: {{ builder_wine.c_drive }}/Python27/python.exe
user: {{ builder_wine.user }}
- Execute:
name: download-pgit
command: curl -o {{ builder_wine.src }}/PortableGit-1.8.5.2-preview20131230.7z https://msysgit.googlecode.com/files/PortableGit-1.8.5.2-preview20131230.7z
creates: {{ builder_wine.src }}/PortableGit-1.8.5.2-preview20131230.7z
user: {{ builder_wine.user }}
- Execute:
name: unpack-git
command: 7z x -o{{ builder_wine.c_drive }}/Git {{ builder_wine.src }}/PortableGit-1.8.5.2-preview20131230.7z
creates: {{ builder_wine.c_drive }}/Git/bin/git.exe
user: {{ builder_wine.user }}
- Execute:
name: download-mingw
command: curl -L -o {{ builder_wine.src }}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip http://sourceforge.net/projects/mingw/files/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip/download
creates: {{ builder_wine.src }}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip
user: {{ builder_wine.user }}
- Execute:
name: unpack-mingw
command: unzip -d {{ builder_wine.c_drive }}/MinGW {{ builder_wine.src }}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip
creates: {{ builder_wine.c_drive }}/MinGW/bin/mingw-get.exe
user: {{ builder_wine.user }}
- Execute:
name: install-gcc
command: wine {{ builder_wine.c_drive }}/MinGW/bin/mingw-get.exe install gcc mingw-utils
creates: {{ builder_wine.c_drive }}/MinGW/bin/gcc.exe
user: {{ builder_wine.user }}
# pycrypto 2.6.1 workaround
# https://github.com/kpdyer/fteproxy/issues/73
# https://bugs.launchpad.net/pycrypto/+bug/1250278
# The offending line in setup.py is gone in master, but no release with that fix
- Execute:
name: patch-headers
commands:
- sed -i {{ builder_wine.c_drive }}/MinGW/include/io.h -e 's/off64_t/_off64_t/g'
- sed -i {{ builder_wine.c_drive }}/MinGW/include/unistd.h -e 's/off_t/_off_t/g'
touch: {{ builder_wine.c_drive }}/MinGW/patched-headers
user: {{ builder_wine.user }}
- Execute:
name: force-wine-path
command: wine reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path /d "C:/Python27/Scripts;C:/Python27;C:/MinGW/bin;C:/Git/bin;C:/windows/system32;C:/windows;C:/windows/system32/Wbem" /f
user: {{ builder_wine.user }}
unless: wine python -V
- Execute:
name: python27-pexports
command: sh -c "wine pexports {{ builder_wine.c_drive }}/windows/system32/python27.dll > {{ builder_wine.c_drive }}/Python27/libs/python27.def"
creates: {{ builder_wine.c_drive }}/Python27/libs/python27.def
user: {{ builder_wine.user }}
- Execute:
name: python27-dlltool
command: wine dlltool -C -d C:\\Python27\\libs\\python27.def -l C:\\Python27\\libs\\libpython27.a
creates: {{ builder_wine.c_drive }}/Python27/libs/libpython27.a
user: {{ builder_wine.user }}
- File:
name: {{ builder_wine.home }}/pydistutils.cfg
# name: {{ builder_wine.c_drive }}/Python27/Lib/distutils/distutils.cfg
source: builder_wine/distutils.cfg
owner: {{ builder_wine.user }}
- File:
name: {{ builder_wine.c_drive }}/Python27/Lib/distutils/cygwinccompiler.py
source: builder_wine/cygwinccompiler.py
owner: {{ builder_wine.user }}
- File:
name: {{ builder_wine.c_drive }}/Python27/Lib/site.py
source: builder_wine/site.py
owner: {{ builder_wine.user }}
- File:
name: {{ builder_wine.src }}/get-pip.py
source: builder_wine/get-pip.py
owner: {{ builder_wine.user }}
- Execute:
name: get-pip.py
command: wine python {{ builder_wine.src }}/get-pip.py
user: {{ builder_wine.user }}
creates: {{ builder_wine.c_drive }}/Python27/Scripts/pip.exe
- Execute:
name: pip-install-virtualenv
command: wine python -m pip install virtualenv
user: {{ builder_wine.user }}
creates: {{ builder_wine.c_drive }}/Python27/Scripts/virtualenv.exe
- Execute:
name: pip-install-wheel
command: wine python -m pip install wheel
user: {{ builder_wine.user }}
creates: {{ builder_wine.c_drive }}/Python27/Scripts/wheel.exe
- Execute:
name: download-py2exe
command: curl -L -o {{ builder_wine.src }}/py2exe-0.6.9.win32-py2.7.exe http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe/download
creates: {{ builder_wine.src }}/py2exe-0.6.9.win32-py2.7.exe
user: {{ builder_wine.user }}
- Execute:
name: wheel-convert-py2exe
command: wine python -m wheel convert -d {{ builder_wine.wheels }} {{ builder_wine.src }}/py2exe-0.6.9.win32-py2.7.exe
user: {{ builder_wine.user }}
creates: {{ builder_wine.wheels }}/py2exe-0.6.9-cp27-none-win32.whl
- Directory:
name: {{ builder_wine.home }}/pip
owner: {{ builder_wine.user }}
- File:
name: {{ builder_wine.home }}/pip/pip.ini
source: builder_wine/pip.ini
owner: {{ builder_wine.user }}
new Provisioner as releasebot:
new Compute as server:
name: releasebot
driver: VMWARE
image: http://yaybu.com/library/ubuntu-12.04.3-server-amd64.zip
user: ubuntu
password: password
resources:
- Package:
- name: curl
- name: vim-nox
- name: python-dev
- Directory:
name: /var/local/releasebot
extend resources: {{ master.resources }}
extend resources: {{ builder_deb.resources }}
extend resources: {{ builder_wine.resources }}