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
|
2020-02-08 00:17:42 +03:00
|
|
|
from BuildBotLib.secretManager import SecretManager
|
2020-12-22 14:30:07 +03:00
|
|
|
from pathlib import Path
|
2021-09-09 10:56:07 +03:00
|
|
|
from BuildBotLib.customgithubhandler import CustomGitHubHandler
|
2021-09-21 10:19:52 +03:00
|
|
|
from BuildBotLib.customgiteahandler import CustomGiteaHandler
|
2019-07-22 10:20:59 +03:00
|
|
|
|
2019-12-26 13:48:06 +03:00
|
|
|
|
|
|
|
class BuildBotChangeSource(BuildBotModule):
|
2020-06-19 11:09:23 +03:00
|
|
|
def __init__(self, masterConf):
|
|
|
|
BuildBotModule.__init__(self, masterConf)
|
2020-12-22 14:38:35 +03:00
|
|
|
secretpath = str(Path.home()) + "/buildBotSecret/secret.json"
|
|
|
|
secret = SecretManager(secretpath)
|
2020-02-08 00:17:42 +03:00
|
|
|
|
2020-06-19 13:13:20 +03:00
|
|
|
self.masterConf['www']['change_hook_dialects'] = {
|
2020-06-19 10:46:42 +03:00
|
|
|
'github':
|
|
|
|
{
|
|
|
|
'secret': secret.getValue('WebHook'),
|
2021-09-09 10:56:07 +03:00
|
|
|
'class': CustomGitHubHandler
|
2020-06-19 10:46:42 +03:00
|
|
|
},
|
2021-09-21 10:19:52 +03:00
|
|
|
'gitea': {
|
|
|
|
'secret': secret.getValue('WebHookGitiea'),
|
|
|
|
'onlyIncludePushCommit': True,
|
|
|
|
'class': CustomGiteaHandler
|
|
|
|
}
|
2020-06-19 13:13:20 +03:00
|
|
|
}
|