forked from planetlab/build
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-conf-planetlab.py
More file actions
executable file
·88 lines (77 loc) · 2.93 KB
/
build-conf-planetlab.py
File metadata and controls
executable file
·88 lines (77 loc) · 2.93 KB
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
#!/usr/bin/python
###
# Nightly build spec HOWTO
#
# * To add a 'build spec', define a dictionary as in the following examples, filling in the values you would like to override in the defaults. Any values you leave out
# will get picked up from the defaults at the bottom of this fiel.
#
# * A build spec may define multiple builds encapsulating various combinations of the available parameter options. To do so,
# set a parameter to a list, and the parent script will automatically turn it into the combinations it encloses. e.g., the following
# build spec defines 6 separate builds:
#
# my_build = {
# 'fcdistro':['centos5','f8','f10'],
# 'personality':['linux32','linux65']
#
# * If your parameters have dependencies - e.g. you only want to build the linu64 personality on f10, then define the parameter as a lambda operating
# on the current build spec. e.g. in this case, it would be to the effect of lambda (build): if (build['fcdistro']=='f10') then ['linux32','linux64'] else ['linux32']
#
#caglar_k32_build = {
# 'tags':'planetlab-k32-tags.mk',
# 'fcdistro':['f12', 'centos5','f8'],
# 'personality':['linux32','linux64'],
# 'test':0,
# 'release':'k32'
#}
sapans_k27_build = {
'tags':'planetlab-k27-tags.mk',
'fcdistro':['f12', 'centos5','f8'],
'personality':['linux32','linux64'],
'test':0,
'release':'k27'
}
marcs_k22_build = {
'tags':'planetlab-tags.mk',
'fcdistro':['f12', 'centos5','f8'],
'personality':['linux32','linux64'],
'test': 0,
'release':'k22',
}
###
#
# DEFAULTS
#
# Any values that you leave out from the above specs will get filled in by the defaults specified below.
# You shouldn't need to modify these values to add new builds
__personality_to_arch__={'linux32':'i386','linux64':'x86_64'}
__flag_to_test__={0:'-B', 1:''}
def __check_out_build_script__(build):
import os
tmpname = os.popen('mktemp -d /tmp/'+build['build-script']+'.XXXXXX').read().rstrip('\n')
os.system("git clone --depth 1 %s %s" % (build['scmpath'], tmpname))
return "%s/%s" % (tmpname, build['build-script'])
def __today__():
import datetime
return datetime.datetime.now().strftime("%Y-%m-%d")
__default_build__ = {
### Simple parameters
'tags':'planetlabs-tags.mk',
'fcdistro':'centos5',
'personality':'linux32',
'test':0,
'release':'k22',
'path':'/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin',
'sh':'/bin/bash',
'mailto':'build@lists.planet-lab.org',
'build-script':'vbuild-nightly.sh',
'webpath':'/vservers/build.planet-lab.org/var/www/html/install-rpms/archive',
'pldistro':'planetlab',
'date': __today__(),
'scmpath':'git://git.planet-lab.org/build.git',
'personality':'linux32',
'myplcversion':'4.3',
### Parameters with dependencies: define paramater mappings as lambdas here
'arch':lambda build: __personality_to_arch__[build['personality']],
'runtests':lambda build: __flag_to_test__[build['test']],
'vbuildnightly':lambda build: __check_out_build_script__(build)
}