summaryrefslogtreecommitdiff
path: root/buildbot/master.cfg
blob: ab1a80efc98722a3adeaea15ab25aba15e25be37 (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
# -*- python -*-
# ex: set syntax=python:

c = BuildmasterConfig = {}
local = "${HOME}/local"

####### BUILDSLAVES

from buildbot.buildslave import BuildSlave
c['slaves'] = [BuildSlave("testSlave", "taler"), BuildSlave("demoSlave", "taler")]

c['protocols'] = {'pb': {'port': 9989}}

####### CHANGESOURCES


from buildbot.changes.gitpoller import GitPoller
c['change_source'] = []
c['change_source'].append(GitPoller(
        'git://git.taler.net/exchange.git',
        workdir='gitpoller-workdir', branches=True,
        pollinterval=300))

####### SCHEDULERS

from buildbot.schedulers.basic import SingleBranchScheduler, Dependent
from buildbot.schedulers.forcesched import *
from buildbot.changes import filter

c['schedulers'] = []
git_master = SingleBranchScheduler(
    name="exchange-master",
    reason="Commit pushed to the git repository",
    change_filter=filter.ChangeFilter(branch='master'),
    treeStableTimer=600,
    builderNames=["exchange-test-build"])

git_stable = SingleBranchScheduler(
    name="exchange-stable",
    reason="Commit pushed to the git repository",
    change_filter=filter.ChangeFilter(branch='stable'),
    treeStableTimer=600,
    builderNames=["exchange-demo-build"])

force = ForceScheduler(		
    name="force-build",
    revision=FixedParameter(name="revision", default=""),
    repository=FixedParameter(name="repository", default=""),
    project=FixedParameter(name="project", default=""),
    builderNames=["exchange-test-build"])

# successful = Dependent(
#     name="exchange-perf",
#     upstream=git,
#     builderNames=["exchange-perf"])

c['schedulers'] = [git_master, force]

####### BUILDERS

from buildbot.process.factory import BuildFactory
from buildbot.steps.source.git import Git
from buildbot.steps.shell import ShellCommand
from buildbot.steps.shell import Configure
from buildbot.steps.shell import Compile
from buildbot.steps.shell import Test
import os


# Demo builder
exchangeDemoBuild = BuildFactory()
exchangeDemoBuild.addStep(Git(repourl='git://git.taler.net/exchange.git', mode='full', method='fresh', branch='stable'))
exchangeDemoBuild.addStep(ShellCommand(
	name="bootstrap",
	description="bootstraping",
	descriptionDone="bootstraped",
	command=["./bootstrap"], 
	hideStepIf=True))
exchangeDemoBuild.addStep(Configure(command=["./configure", "--prefix="+local, "--with-gnunet="+local]))
exchangeDemoBuild.addStep(Compile(command=["make"]))
exchangeDemoBuild.addStep(ShellCommand(name="Install", 
                               description="Installing", 
                               command=["make", "install"]))
# Starting from a clean database
exchangeDemoBuild.addStep(ShellCommand(name="Drop database", 
                               command=["psql", "-c", "DROP DATABASE talercheck"], 
                               hideStepIf=True,
                               flunkOnFailure=False))
exchangeDemoBuild.addStep(ShellCommand(name="Create database", 
                               command=["psql", "-c", "CREATE DATABASE talercheck"], 
                               hideStepIf=True))
# run the tests
exchangeDemoBuild.addStep(Test(command=["make","check"],
                       env={'PATH':local + "/bin:" + os.environ['PATH']}))

# Test builder
exchangeTestBuild = BuildFactory()
exchangeTestBuild.addStep(Git(repourl='git://git.taler.net/exchange.git', mode='full', method='fresh', branch='master'))
exchangeTestBuild.addStep(ShellCommand(
	name="bootstrap",
	description="bootstraping",
	descriptionDone="bootstraped",
	command=["./bootstrap"], 
	hideStepIf=True))
exchangeTestBuild.addStep(Configure(command=["./configure", "--prefix="+local, "--with-gnunet="+local]))
exchangeTestBuild.addStep(Compile(command=["make"]))
exchangeTestBuild.addStep(ShellCommand(name="Install", 
                               description="Installing", 
                               command=["make", "install"]))
# Starting from a clean database
exchangeTestBuild.addStep(ShellCommand(name="Drop database", 
                               command=["psql", "-c", "DROP DATABASE talercheck"], 
                               hideStepIf=True,
                               flunkOnFailure=False))
exchangeTestBuild.addStep(ShellCommand(name="Create database", 
                               command=["psql", "-c", "CREATE DATABASE talercheck"], 
                               hideStepIf=True))
# run the tests
exchangeTestBuild.addStep(Test(command=["make","check"],
                       env={'PATH':local + "/bin:" + os.environ['PATH']}))

# running the performance tests for Taler
exchangePerf = BuildFactory()

# compile 
exchangePerf.addStep(Git(repourl='git://git.taler.net/exchange.git', 
                 mode='full', 
                 method = 'fresh'))
exchangePerf.addStep(ShellCommand(
	               name="bootstrap",
	               description="bootstraping",
                 descriptionDone="bootstraped",
                 command=["./bootstrap"], 
                 hideStepIf=True))
exchangePerf.addStep(Configure(command=["./configure", "--prefix="+local, "--with-gnunet="+local]))
exchangePerf.addStep(Compile(command=["make"]))
exchangePerf.addStep(Compile(command=["make","-C","src/exchangedb/","perf-exchangedb"]))

# create the database anew
exchangePerf.addStep(ShellCommand(name="Drop database", 
                              command=["psql", 
                                       "-c",
                                       "DROP DATABASE talercheck"], 
                              hideStepIf=True))
exchangePerf.addStep(ShellCommand(name="Create database", 
                              command=["psql", 
                                       "-c",
                                       "CREATE DATABASE talercheck"], 
                              hideStepIf=True))

# Run the performance tests
exchangePerf.addStep(ShellCommand(name="perf-measure",
			                        description="measuring",
			                        descriptionDone="measured",		
			                        command=["./perf-exchangedb"],
                              workdir="build/src/exchangedb",
                              timeout=None))

from buildbot.config import BuilderConfig

c['builders'] = []
c['builders'].append(
    BuilderConfig(name="exchange-test-build",
                  slavenames=["testSlave"],
                  factory=exchangeTestBuild))
c['builders'].append(
    BuilderConfig(name="exchange-demo-build",
                  slavenames=["demoSlave"],
                  factory=exchangeDemoBuild))
# To be adapted to the new test/demo setting
# c['builders'].append(
#     BuilderConfig(name="exchange-perf",
#                   slavenames=slaveNames,
#                   factory=exchangePerf))

####### STATUS TARGETS

c['status'] = []
from buildbot.status import html
from buildbot.status.web import authz, auth

authz_cfg=authz.Authz(
    # change any of these to True to enable; see the manual for more
    # options
    auth=auth.BasicAuth([("marcello","taler")]),
    gracefulShutdown = False,
    forceBuild = 'auth', # use this to test your slave once it is set up
    forceAllBuilds = False,
    pingBuilder = False,
    stopBuild = False,
    stopAllBuilds = False,
    cancelPendingBuild = False,
)
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))

####### PROJECT IDENTITY
c['title'] = "Taler"
c['titleURL'] = "http://taler.net"

c['buildbotURL'] = "http://buildbot.taler.net"

####### DB URL
c['db'] = {
    'db_url' : "sqlite:///state.sqlite",
}