4
0
mirror of https://github.com/QuasarApp/QuasarAppCI.git synced 2025-04-28 06:34:35 +00:00
QuasarAppCI/BuildBotLib/buildBotIdentity.py

66 lines
2.4 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
2020-12-22 14:38:35 +03:00
from pathlib import Path
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):
2020-06-19 11:09:23 +03:00
def __init__(self, masterConf):
BuildBotModule.__init__(self, masterConf)
2020-04-15 10:18:14 +03:00
2019-07-22 10:20:59 +03:00
self.masterConf['title'] = "QuasarApp CI"
2022-10-17 17:56:30 +03:00
quasarapp_path = 'https://github.com/QuasarApp'
self.masterConf['titleURL'] = quasarapp_path
2019-12-26 13:48:06 +03:00
# 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.
2020-06-10 21:35:53 +03:00
self.masterConf['buildbotURL'] = "https://quasarapp.ddns.net:8043/"
2019-07-22 10:20:59 +03:00
# 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={},
2022-10-17 17:56:30 +03:00
grid_view={}
)
)
2019-07-22 10:20:59 +03:00
2021-01-04 17:30:08 +03:00
scr = SecretManager(str(Path.home()) + "/buildBotSecret/secret.json")
self.masterConf['www']['auth'] = util.GitHubAuth(
scr.getValue("QuasarAppCIID"),
scr.getValue("QuasarAppCIToken"),
apiVersion=4, getTeamsMembership=True)
2019-07-22 10:20:59 +03:00
self.masterConf['www']['authz'] = util.Authz(
2021-04-06 10:13:38 +03:00
stringsMatcher=util.fnmatchStrMatcher,
2019-12-26 13:48:06 +03:00
allowRules=[
2021-04-06 10:25:44 +03:00
util.AnyEndpointMatcher(role="QuasarApp"),
2021-04-06 10:03:35 +03:00
2019-07-22 10:20:59 +03:00
],
2019-12-26 13:48:06 +03:00
roleMatchers=[
2021-04-06 09:53:52 +03:00
util.RolesFromGroups(groupPrefix=''),
2021-04-06 09:36:37 +03:00
util.RolesFromUsername(roles=[
"admins",
],
usernames=[
"EndrII"
]),
2020-01-04 12:50:07 +03:00
util.RolesFromOwner(role="owner")
2020-01-03 19:10:46 +03:00
2019-07-22 21:36:02 +03:00
]
2019-07-22 10:20:59 +03:00
)