-
Notifications
You must be signed in to change notification settings - Fork 0
/
master.cfg
122 lines (84 loc) · 3.56 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
# first, reload each module by name
import sys
sys.path.insert(0, "/var/lib/buildbot/config")
import workers
from buildbot.plugins import util
import os
from buildbot.plugins import *
from twisted.internet import defer
from buildbot.config import BuilderConfig
from buildbot.plugins import schedulers
from buildbot.plugins import steps
from buildbot.process.factory import BuildFactory
from buildbot.process.results import SUCCESS
from buildbot.util import kubeclientservice
from buildbot.worker import kubernetes
c = BuildmasterConfig = {}
num_concurrent=10
##########################
####### CHANGESOURCES
# the 'change_source' setting tells the buildmaster how it should find out
# about source code changes. Here we point to the buildbot clone of pyflakes.
c['change_source'] = []
c['change_source'].append(changes.GitPoller(
'https://github.com/leiyang/buildbot-docker-example-config.git',
workdir='gitpoller-workdir', branch='master',
pollinterval=5))
c['schedulers'] = []
c['schedulers'].append(schedulers.SingleBranchScheduler(
name="all",
change_filter=util.ChangeFilter(branch='master'),
treeStableTimer=None,
builderNames=["runtests"]))
c['schedulers'].append(schedulers.ForceScheduler(
name="force",
builderNames=["runtests"]))
f = BuildFactory()
f.addStep(steps.ShellCommand(command='echo hello'))
f.addStep(steps.ShellCommand(command='echo world'))
c['builders'] = [
BuilderConfig(
name="runtests",
workernames=["kubernetes" + str(i) for i in range(num_concurrent)],
factory=f)
]
#########################################################
c['workers'] = workers.workers
# bbtravis already setups www, we must override some of the config after
c['projectName'] = "Buildbot"
c['projectURL'] = "http://buildbot.net/"
#c['buildbotNetUsageData'] = None
# configure a janitor which will delete all logs older than two month, and will run on sundays at noon
#kube_config=kubeclientservice.KubeInClusterConfigLoader()
#kube_config.reconfigService()
#data=kube_config.getConfig()
#print(data)
# un comment for debugging what happens if things looks locked.
# c['www'] = {'port': 8080}
c['protocols'] = {"pb": {"port": "tcp:9989"}}
#return c
#c=masterConfig(10)
####### 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,
# like IRC bots.
c['status'] = []
####### PROJECT IDENTITY
# the 'title' string will appear at the top of this buildbot installation's
# home pages (linked to the 'titleURL').
c['title'] = "Pyflakes"
c['titleURL'] = "https://launchpad.net/pyflakes"
# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server is visible. This typically uses the port number set in
# the 'www' entry below, but with an externally-visible host name which the
# buildbot cannot figure out without some help.
c['buildbotURL'] = os.environ.get("BUILDBOT_WEB_URL", "http://localhost:8010/")
# minimalistic config to activate new web UI
c['www'] = dict(port=os.environ.get("BUILDBOT_WEB_PORT", 8010),
plugins=dict(waterfall_view={}, console_view={}))
####### DB URL
c['db'] = {
# This specifies what database buildbot uses to store its state. You can leave
# this at its default for all but the largest installations.
'db_url' : os.environ.get("BUILDBOT_DB_URL", "sqlite://").format(**os.environ),
}