mirror of
https://github.com/QuasarApp/QuasarAppCI.git
synced 2025-05-08 11:19:41 +00:00
added support gitea
This commit is contained in:
parent
73cdecc5bd
commit
c23dee5f7c
@ -24,6 +24,8 @@
|
||||
"qifRepogen.py",
|
||||
"docs.py",
|
||||
"stepfactory.py",
|
||||
"customgithubhandler.py"
|
||||
"customgithubhandler.py",
|
||||
"customgiteahandler.py"
|
||||
|
||||
]
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ from BuildBotLib.buildBotModule import BuildBotModule
|
||||
from BuildBotLib.secretManager import SecretManager
|
||||
from pathlib import Path
|
||||
from BuildBotLib.customgithubhandler import CustomGitHubHandler
|
||||
from BuildBotLib.customgiteahandler import CustomGiteaHandler
|
||||
|
||||
|
||||
class BuildBotChangeSource(BuildBotModule):
|
||||
@ -17,4 +18,9 @@ class BuildBotChangeSource(BuildBotModule):
|
||||
'secret': secret.getValue('WebHook'),
|
||||
'class': CustomGitHubHandler
|
||||
},
|
||||
'gitea': {
|
||||
'secret': secret.getValue('WebHookGitiea'),
|
||||
'onlyIncludePushCommit': True,
|
||||
'class': CustomGiteaHandler
|
||||
}
|
||||
}
|
||||
|
@ -34,5 +34,12 @@ class BuildBotServices(BuildBotModule):
|
||||
verbose=True,
|
||||
generators=[status_generator]
|
||||
)
|
||||
gt = reporters.GiteaStatusPush(
|
||||
'https://quasarapp.ddns.net:3000/',
|
||||
secret.getValue('gitea'),
|
||||
verbose=True,
|
||||
generators=[status_generator]
|
||||
)
|
||||
|
||||
self.masterConf['services'].append(gc)
|
||||
self.masterConf['services'].append(gt)
|
||||
|
20
BuildBotLib/customgiteahandler.py
Normal file
20
BuildBotLib/customgiteahandler.py
Normal file
@ -0,0 +1,20 @@
|
||||
# This Python file uses the following encoding: utf-8
|
||||
|
||||
# if __name__ == "__main__":
|
||||
# pass
|
||||
|
||||
from buildbot_gitea.webhook import GiteaHandler
|
||||
|
||||
class CustomGiteaHandler(GiteaHandler):
|
||||
|
||||
def handle_push(self, payload, event):
|
||||
# This field is unused:
|
||||
|
||||
payload['repository']['html_url'] = payload['repository']['ssh_url']
|
||||
return super().handle_push(payload, event)
|
||||
|
||||
|
||||
def handle_pull_request(self, payload, event):
|
||||
|
||||
payload['repository']['html_url'] = payload['repository']['ssh_url']
|
||||
return super().handle_pull_request(payload, event)
|
3
start.sh
3
start.sh
@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
#pip install treq
|
||||
pip install treq
|
||||
pip install buildbot_gitea
|
||||
BASE_DIR=$(dirname "$(readlink -f "$0")")
|
||||
|
||||
buildbot start $BASE_DIR
|
||||
|
Loading…
x
Reference in New Issue
Block a user