forked from SFML/SFML-Buildbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
status.py
78 lines (68 loc) · 2.12 KB
/
status.py
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
def get_irc():
from buildbot.status import words
return words.IRC(
host = '<IRC server redacted>',
nick = '<IRC nick redacted>',
channels = ['<IRC channels redacted>'],
notify_events = {
'started' : 1,
'finished' : 1,
'failure' : 1,
'success' : 1,
'exception' : 1
}
)
def get_other_irc():
from buildbot.status import words
return words.IRC(
host = '<IRC server redacted>',
nick = '<IRC nick redacted>',
channels = ['<IRC channels redacted>'],
notify_events = {
'started' : 0,
'finished' : 0,
'failure' : 0,
'success' : 0,
'exception' : 0
}
)
def get_web():
from buildbot.status import html
from buildbot.status.web import authz, auth
import users
users = users.get_users()
authz_cfg = authz.Authz(
auth = auth.BasicAuth(users),
view = True,
forceBuild = 'auth',
forceAllBuilds = 'auth',
pingBuilder = 'auth',
gracefulShutdown = False,
pauseSlave = 'auth',
stopBuild = 'auth',
stopAllBuilds = 'auth',
cancelPendingBuild = 'auth',
cancelAllPendingBuilds = 'auth',
stopChange = 'auth',
cleanShutdown = False,
showUsersPage = 'auth'
)
return html.WebStatus(
http_port = "tcp:8010:interface=127.0.0.1",
authz = authz_cfg,
change_hook_dialects = {'github' : {}},
change_hook_auth = ['file:changehook.passwd']
)
def get_github_status():
from buildbot.process.properties import Interpolate
from buildbot.status.github import GitHubStatus
return GitHubStatus(
token = '<token redacted>',
repoOwner = 'SFML',
repoName = 'SFML',
sha = Interpolate("%(prop:got_revision)s"),
startDescription = Interpolate("Build #%(prop:buildnumber)s started."),
endDescription = Interpolate("Build #%(prop:buildnumber)s done."),
)
def get_status():
return [get_web(), get_irc(), get_other_irc(), get_github_status()]