Welcome to mirror list, hosted at ThFree Co, Russian Federation.

master.cfg « buildbot « build_files - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 220fa08b23a1cd148258d85273b61198dfddd8ba (plain)
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
# -*- python -*-
# ex: set syntax=python:

# <pep8 compliant>

# Dictionary that the buildmaster pays attention to.
c = BuildmasterConfig = {}

# BUILD SLAVES
#
# We load the slaves and their passwords from a separator file, so we can have
# this one in SVN.

from buildbot.buildslave import BuildSlave
import master_private

c['slaves'] = []

for slave in master_private.slaves:
    c['slaves'].append(BuildSlave(slave['name'], slave['password']))

# TCP port through which slaves connect

c['slavePortnum'] = 9989

# CHANGE SOURCES

from buildbot.changes.svnpoller import SVNPoller
from buildbot.changes.gitpoller import GitPoller

c['change_source'] = GitPoller(
       'git://git.blender.org/blender.git',
       pollinterval=1200)

# SCHEDULERS
#
# Decide how to react to incoming changes.

# from buildbot.scheduler import Scheduler
from buildbot.schedulers import timed

c['schedulers'] = []

def schedule_build(name, hour, minute=0):
    c['schedulers'].append(timed.Nightly(name='nightly ' + name,
        builderNames=[name],
        hour=hour,
        minute=minute))

"""
schedule_cycle = 4

for i in range(0, schedule_cycle):
    names = []
    for j in range(0, len(buildernames)):
        if j % schedule_cycle == i:
            names += [buildernames[j]]

    print(names)
    c['schedulers'].append(timed.Nightly(name='nightly' + str(i),
        builderNames=names,
        hour=3+i,
        minute=0))
"""

# BUILDERS
#
# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
# what steps, and which slaves can execute them.  Note that any particular build will
# only take place on one slave.

from buildbot.process.factory import BuildFactory
from buildbot.steps.source import SVN
from buildbot.steps.source import Git
from buildbot.steps.shell import ShellCommand
from buildbot.steps.shell import Compile
from buildbot.steps.shell import Test
from buildbot.steps.transfer import FileUpload
# from buildbot.steps.transfer import FileDownload
from buildbot.steps.master import MasterShellCommand
from buildbot.config import BuilderConfig

# add builder utility

c['builders'] = []
buildernames = []


def add_builder(c, name, libdir, factory, branch='', rsync=False, hour=3, minute=0):
    slavenames = []

    for slave in master_private.slaves:
        if name in slave['builders']:
            slavenames.append(slave['name'])

    if len(slavenames) > 0:
        f = factory(name, libdir, branch, rsync)
        c['builders'].append(BuilderConfig(name=name, slavenames=slavenames, factory=f, category='blender'))
        buildernames.append(name)

        schedule_build(name, hour, minute)

# common steps

def git_submodule_step(submodule):
    return Git(name=submodule+'.git', repourl='git://git.blender.org/' + submodule + '.git', mode='update', workdir=submodule + '.git')

def git_step(branch=''):
    if branch:
        return Git(name='blender.git', repourl='git://git.blender.org/blender.git', mode='update', branch=branch, workdir='blender.git', submodules=True)
    else:
        return Git(name='blender.git', repourl='git://git.blender.org/blender.git', mode='update', workdir='blender.git', submodules=True)

def git_submodules_update():
    command = ['git', 'submodule', 'foreach', '--recursive', 'git', 'pull', 'origin', 'master']
    return ShellCommand(name='Submodules Update', command=command, description='updating', descriptionDone='up to date', workdir='blender.git')

def lib_svn_step(dir):
    return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir)

def rsync_step(id, branch, rsync_script):
    return ShellCommand(name='rsync', command=['python', rsync_script, id, branch], description='uploading', descriptionDone='uploaded', workdir='install')

# generic builder


def generic_builder(id, libdir='', branch='', rsync=False):
    filename = 'uploaded/buildbot_upload_' + id + '.zip'
    compile_script = '../blender.git/build_files/buildbot/slave_compile.py'
    test_script = '../blender.git/build_files/buildbot/slave_test.py'
    pack_script = '../blender.git/build_files/buildbot/slave_pack.py'
    rsync_script = '../blender.git/build_files/buildbot/slave_rsync.py'
    unpack_script = 'master_unpack.py'

    f = BuildFactory()
    for submodule in ('blender-translations', 'blender-addons', 'blender-addons-contrib', 'scons'):
        f.addStep(git_submodule_step(submodule))
    f.addStep(git_step(branch))
    f.addStep(git_submodules_update())
    if libdir != '':
        f.addStep(lib_svn_step(libdir))

    f.addStep(Compile(command=['python', compile_script, id], timeout=3600))
    f.addStep(Test(command=['python', test_script, id]))
    f.addStep(ShellCommand(name='package', command=['python', pack_script, id, branch], description='packaging', descriptionDone='packaged'))
    if rsync:
        f.addStep(rsync_step(id, branch, rsync_script))
    elif id.find('cmake') != -1:
        f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024))
    else:
        f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024, workdir='install'))
    f.addStep(MasterShellCommand(name='unpack', command=['python', unpack_script, filename], description='unpacking', descriptionDone='unpacked'))
    return f

# builders

add_builder(c, 'mac_x86_64_10_6_scons', 'darwin-9.x.universal', generic_builder, hour=5)
add_builder(c, 'mac_i386_10_6_scons', 'darwin-9.x.universal', generic_builder, hour=11)
add_builder(c, 'linux_glibc211_i386_scons', '', generic_builder, hour=1)
add_builder(c, 'linux_glibc211_x86_64_scons', '', generic_builder, hour=2)
add_builder(c, 'win32_scons', 'windows', generic_builder, hour=1)
add_builder(c, 'win64_scons', 'win64', generic_builder, hour=2)
add_builder(c, 'win32_scons_vc2012', 'windows_vc11', generic_builder, hour=1)
add_builder(c, 'win64_scons_vc2012', 'win64_vc11', generic_builder, hour=2)
#add_builder(c, 'mingw_win32_scons', 'mingw32', generic_builder, hour=4)
add_builder(c, 'mingw_win64_scons', 'mingw64', generic_builder, hour=3)
#add_builder(c, 'freebsd_i386_cmake', '', generic_builder, hour=1)
#add_builder(c, 'freebsd_x86_64_cmake', '', generic_builder, hour=2)

# Multiview branch
add_builder(c, 'multiview_win64_scons', 'win64', generic_builder, 'multiview', hour=4)
add_builder(c, 'multiview_win32_scons', 'windows', generic_builder, 'multiview', hour=5)

# STATUS TARGETS
#
# 'status' is a list of Status Targets. The results of each build will be
# pushed to these targets. buildbot/status/*.py has a variety to choose from,
# including web pages, email senders, and IRC bots.

c['status'] = []

from buildbot.status import html
from buildbot.status.web import authz
from buildbot.status.web import auth

users = []
for slave in master_private.slaves:
    users += [(slave['name'], slave['password'])]

authz_cfg = authz.Authz(
    auth=auth.BasicAuth(users),
    # change any of these to True to enable; see the manual for more
    # options
    gracefulShutdown=False,
    forceBuild='auth',  # use this to test your slave once it is set up
    forceAllBuilds=False,
    pingBuilder=False,
    stopBuild='auth',
    stopAllBuilds=False,
    cancelPendingBuild='auth',
)

c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))

# PROJECT IDENTITY

c['projectName'] = "Blender"
c['projectURL'] = "http://www.blender.org"

# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server (usually the html.WebStatus page) is visible. This
# typically uses the port number set in the Waterfall 'status' entry, but
# with an externally-visible host name which the buildbot cannot figure out
# without some help.

c['buildbotURL'] = "http://builder.blender.org/"

# DB URL
#
# This specifies what database buildbot uses to store change and scheduler
# state.  You can leave this at its default for all but the largest
# installations.

c['db_url'] = "sqlite:///state.sqlite"