QuasarAppCI/BuildBotLib/buildBotIdentity.py

58 lines
2.2 KiB
Python
Raw Normal View History

2019-07-22 10:20:59 +03:00
# This Python file uses the following encoding: utf-8
2019-12-26 13:48:06 +03:00
from BuildBotLib.buildBotModule import BuildBotModule
from BuildBotLib.secretManager import SecretManager
from buildbot.plugins import util
2019-07-22 10:20:59 +03:00
2019-12-26 13:48:06 +03:00
# PROJECT IDENTITY
2019-07-22 10:20:59 +03:00
# the 'title' string will appear at the top of this buildbot installation's
# home pages (linked to the 'titleURL').
2019-12-26 13:48:06 +03:00
class BuildBotIdentity(BuildBotModule):
2019-07-22 10:20:59 +03:00
def __init__(self):
self.masterConf['title'] = "QuasarApp CI"
2019-12-26 13:48:06 +03:00
cqtdeployer_path = 'https://github.com/QuasarApp/CQtDeployer'
self.masterConf['titleURL'] = cqtdeployer_path
# 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
2019-07-22 10:20:59 +03:00
# buildbot cannot figure out without some help.
self.masterConf['buildbotURL'] = "http://quasarapp.ddns.net:8010/"
# minimalistic config to activate new web UI
self.masterConf['www'] = dict(port=8010,
2019-12-26 13:48:06 +03:00
plugins=dict(
waterfall_view={},
console_view={},
grid_view={},
badges={}))
2019-07-22 10:20:59 +03:00
self.masterConf['www']['authz'] = util.Authz(
2019-12-26 13:48:06 +03:00
allowRules=[
2019-07-22 21:21:58 +03:00
util.AnyEndpointMatcher(role="admins"),
2019-07-22 21:50:20 +03:00
util.ForceBuildEndpointMatcher(role="users"),
util.StopBuildEndpointMatcher(role="users")
2019-07-22 21:21:58 +03:00
2019-07-22 10:20:59 +03:00
],
2019-12-26 13:48:06 +03:00
roleMatchers=[
util.RolesFromUsername(roles=['admins'],
usernames=['EndrII', 'Roma']),
2019-07-22 21:59:45 +03:00
util.RolesFromUsername(roles=['users'], usernames=['ZIG'])
2019-07-22 21:21:58 +03:00
2019-07-22 21:36:02 +03:00
]
2019-07-22 10:20:59 +03:00
)
2019-07-22 12:01:57 +03:00
2019-07-22 17:05:28 +03:00
secret = SecretManager("/home/andrei/buildBotSecret/secret.json")
2019-07-22 16:56:56 +03:00
2019-07-22 10:20:59 +03:00
self.masterConf['www']['auth'] = util.UserPasswordAuth([
2019-07-22 16:56:56 +03:00
('EndrII', secret.getValue("ENDRII")),
2019-07-22 21:36:02 +03:00
('ZIG', secret.getValue("ZIG")),
('Roma', secret.getValue("Roma"))
2019-07-22 17:05:28 +03:00
])