-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaster.cfg
144 lines (114 loc) · 4.46 KB
/
master.cfg
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
# -*- python -*-
# ex: set syntax=python:
#Workers have to be set up with "--umask=0o22" and pre-cloned site-repo
import datetime
from buildbot.plugins import *
from buildbot.www.authz import Authz
from buildbot.www.auth import UserPasswordAuth
from buildbot.www.authz.roles import RolesFromGroups, RolesFromUsername
from buildbot.www.authz.endpointmatchers import AnyControlEndpointMatcher
from buildbot.schedulers.basic import SingleBranchScheduler
from buildbot.schedulers.forcesched import ForceScheduler
from buildbot.changes import filter
c = BuildmasterConfig = {}
####### CONFIG FFMYK
arch = ['ar71xx-generic', 'ar71xx-nand', 'ar71xx-tiny', 'brcm2708-bcm2708', 'brcm2708-bcm2709', 'ipq40xx', 'mpc85xx-generic', 'ramips-mt7620', 'ramips-mt7621', 'ramips-mt76x8', 'ramips-rt305x', 'sunxi-cortexa7', 'x86-generic', 'x86-geode', 'x86-64', 'ar71xx-mikrotik', 'brcm2708-bcm2710', 'ipq806x', 'mvebu-cortexa9'];
####### BUILDSLAVES
c['protocols'] = {'pb': {'port': 9989}}
#c['services'].append(reporters.IRC(host="irc.hackint.org", nick="ffmyk-nightly",
# channels=["#ffmyk-dev"]))
c['workers'] = []
c['workers'].append(worker.Worker('localhost', '***'))
####### CHANGESOURCES
from buildbot.changes.gitpoller import GitPoller
c['change_source'] = []
c['change_source'].append(GitPoller(
'git://github.com/freifunk-gluon/gluon',
workdir='gitpoller-workdir', branch='master',
pollinterval=300))
c['change_source'].append(GitPoller(
'git://github.com/FreifunkMYK/sites-ffmyk',
workdir='gitpoller-workdir', branch='master',
pollinterval=300))
####### SCHEDULERS
c['schedulers'] = []
c['schedulers'].append(SingleBranchScheduler(
name="all",
change_filter=filter.ChangeFilter(branch='master'),
treeStableTimer=None,
builderNames=["runtests"]))
c['schedulers'].append(ForceScheduler(
name="force",
builderNames=["runtests"]))
####### BUILDSTEPS
from buildbot.process.factory import BuildFactory
from buildbot.steps.source.git import Git
from buildbot.steps.shell import ShellCommand
factory = BuildFactory()
factory.addStep(ShellCommand(name = "Fetching site.conf repository",
command = ["git", "pull"],
haltOnFailure = True,
description = "Fetch Site"))
factory.addStep(ShellCommand(name = "Loading submodules",
command = ["git", "submodule", "update", "--init"],
haltOnFailure = True,
description = "Load submodule"))
factory.addStep(ShellCommand(name = "Switching to gluon master",
workdir = "build/gluon",
command = ["git", "checkout", "master"],
haltOnFailure = True,
description = "Switch submodule"))
factory.addStep(ShellCommand(name = "Updating gluon master",
workdir = "build/gluon",
command = ["git", "pull"],
haltOnFailure = True,
description = "Pull submodule"))
factory.addStep(steps.RemoveDirectory(name = "Deleting previous output directory" , dir="output"))
factory.addStep(steps.MakeDirectory(name = "Creating new output directory", dir="output"))
factory.addStep(ShellCommand(name = "Starting Build",
command = ["bash", "build.sh", "ffmyk-nightly-"+str(datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")), ' '.join(arch)],
haltOnFailure = True,
description = "Build",
env={'BROKEN': '1'}
))
factory.addStep(ShellCommand(name = "Upload",
command = ["/usr/local/bin/ffmyk-upload.sh"],
haltOnFailure = True,
description = "Upload"))
factory.addStep(ShellCommand(name = "Cleanup Disk",
command = ["/usr/local/bin/ffmyk-cleanup.sh"],
haltOnFailure = False,
description = "Cleaning Disk"))
####### BUILDERS
from buildbot.config import BuilderConfig
c['builders'] = [util.BuilderConfig(
name = 'runtests',
workernames = ['localhost'],
factory = factory
)]
####### STATUS
c['www'] = {
'port': 8080,
'plugins': dict(
waterfall_view={},
console_view={}
),
'auth': util.UserPasswordAuth([('***', '***')]),
'authz': util.Authz(
allowRules = [
util.AnyEndpointMatcher(role="admins")
],
roleMatchers = [
util.RolesFromUsername(roles=['admins'], usernames=['***'])
]
)
}
####### IDENTITY
c['title'] = "Gluon-FFMYK"
c['titleURL'] = "https://freifunk-myk.de/"
#c['buildbotURL'] = "http://[2a03:2260:1016:302:20c:29ff:fe7d:e3c3]/buildbot/"
c['buildbotURL'] = "http://127.0.0.1:8881/"
####### DB
c['db'] = {
'db_url' : "sqlite:///state.sqlite",
}