mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
Revert "I have no idea why, but apparently we can't load the config inside main() now ..."
This reverts commit 688a1fdc8f
.
This commit is contained in:
parent
688a1fdc8f
commit
b89b1edb24
1 changed files with 54 additions and 53 deletions
107
run.py
107
run.py
|
@ -1746,64 +1746,65 @@ async def listener_after_server_stop(*args, **kwargs):
|
||||||
job.save()
|
job.save()
|
||||||
|
|
||||||
|
|
||||||
default_config = {
|
def main(config="./config.py"):
|
||||||
"BASE_URL": "",
|
|
||||||
"PORT": 4242,
|
|
||||||
"TIMEOUT": 10800,
|
|
||||||
"DEBUG": False,
|
|
||||||
"MONITOR_APPS_LIST": False,
|
|
||||||
"MONITOR_GIT": False,
|
|
||||||
"MONITOR_ONLY_GOOD_QUALITY_APPS": False,
|
|
||||||
"MONTHLY_JOBS": False,
|
|
||||||
"ANSWER_TO_AUTO_UPDATER": True,
|
|
||||||
"WORKER_COUNT": 1,
|
|
||||||
"ARCH": "amd64",
|
|
||||||
"DIST": "bullseye",
|
|
||||||
"YNH_BRANCH": "stable",
|
|
||||||
"PACKAGE_CHECK_DIR": yunorunner_dir + "/package_check/",
|
|
||||||
"WEBHOOK_TRIGGERS": [
|
|
||||||
"!testme",
|
|
||||||
"!gogogadgetoci",
|
|
||||||
"By the power of systemd, I invoke The Great App CI to test this Pull Request!",
|
|
||||||
],
|
|
||||||
"WEBHOOK_CATCHPHRASES": [
|
|
||||||
"Alrighty!",
|
|
||||||
"Fingers crossed!",
|
|
||||||
"May the CI gods be with you!",
|
|
||||||
":carousel_horse:",
|
|
||||||
":rocket:",
|
|
||||||
":sunflower:",
|
|
||||||
"Meow :cat2:",
|
|
||||||
":v:",
|
|
||||||
":stuck_out_tongue_winking_eye:",
|
|
||||||
],
|
|
||||||
"GITHUB_COMMIT_STATUS_TOKEN": None
|
|
||||||
}
|
|
||||||
|
|
||||||
app.config.update_config(default_config)
|
default_config = {
|
||||||
app.config.update_config("./config.py")
|
"BASE_URL": "",
|
||||||
|
"PORT": 4242,
|
||||||
|
"TIMEOUT": 10800,
|
||||||
|
"DEBUG": False,
|
||||||
|
"MONITOR_APPS_LIST": False,
|
||||||
|
"MONITOR_GIT": False,
|
||||||
|
"MONITOR_ONLY_GOOD_QUALITY_APPS": False,
|
||||||
|
"MONTHLY_JOBS": False,
|
||||||
|
"ANSWER_TO_AUTO_UPDATER": True,
|
||||||
|
"WORKER_COUNT": 1,
|
||||||
|
"ARCH": "amd64",
|
||||||
|
"DIST": "bullseye",
|
||||||
|
"YNH_BRANCH": "stable",
|
||||||
|
"PACKAGE_CHECK_DIR": yunorunner_dir + "/package_check/",
|
||||||
|
"WEBHOOK_TRIGGERS": [
|
||||||
|
"!testme",
|
||||||
|
"!gogogadgetoci",
|
||||||
|
"By the power of systemd, I invoke The Great App CI to test this Pull Request!",
|
||||||
|
],
|
||||||
|
"WEBHOOK_CATCHPHRASES": [
|
||||||
|
"Alrighty!",
|
||||||
|
"Fingers crossed!",
|
||||||
|
"May the CI gods be with you!",
|
||||||
|
":carousel_horse:",
|
||||||
|
":rocket:",
|
||||||
|
":sunflower:",
|
||||||
|
"Meow :cat2:",
|
||||||
|
":v:",
|
||||||
|
":stuck_out_tongue_winking_eye:",
|
||||||
|
],
|
||||||
|
"GITHUB_COMMIT_STATUS_TOKEN": None
|
||||||
|
}
|
||||||
|
|
||||||
app.config.PACKAGE_CHECK_PATH = app.config.PACKAGE_CHECK_DIR + "package_check.sh"
|
app.config.update_config(default_config)
|
||||||
app.config.PACKAGE_CHECK_LOCK_PER_WORKER = (
|
app.config.update_config(config)
|
||||||
app.config.PACKAGE_CHECK_DIR + "pcheck-{worker_id}.lock"
|
|
||||||
)
|
|
||||||
app.config.PACKAGE_CHECK_FULL_LOG_PER_WORKER = (
|
|
||||||
app.config.PACKAGE_CHECK_DIR + "full_log_{worker_id}.log"
|
|
||||||
)
|
|
||||||
app.config.PACKAGE_CHECK_RESULT_JSON_PER_WORKER = (
|
|
||||||
app.config.PACKAGE_CHECK_DIR + "results_{worker_id}.json"
|
|
||||||
)
|
|
||||||
app.config.PACKAGE_CHECK_SUMMARY_PNG_PER_WORKER = (
|
|
||||||
app.config.PACKAGE_CHECK_DIR + "summary_{worker_id}.png"
|
|
||||||
)
|
|
||||||
|
|
||||||
if not os.path.exists(app.config.PACKAGE_CHECK_PATH):
|
app.config.PACKAGE_CHECK_PATH = app.config.PACKAGE_CHECK_DIR + "package_check.sh"
|
||||||
print(
|
app.config.PACKAGE_CHECK_LOCK_PER_WORKER = (
|
||||||
f"Error: analyzer script doesn't exist at '{app.config.PACKAGE_CHECK_PATH}'. Please fix the configuration in {config}"
|
app.config.PACKAGE_CHECK_DIR + "pcheck-{worker_id}.lock"
|
||||||
|
)
|
||||||
|
app.config.PACKAGE_CHECK_FULL_LOG_PER_WORKER = (
|
||||||
|
app.config.PACKAGE_CHECK_DIR + "full_log_{worker_id}.log"
|
||||||
|
)
|
||||||
|
app.config.PACKAGE_CHECK_RESULT_JSON_PER_WORKER = (
|
||||||
|
app.config.PACKAGE_CHECK_DIR + "results_{worker_id}.json"
|
||||||
|
)
|
||||||
|
app.config.PACKAGE_CHECK_SUMMARY_PNG_PER_WORKER = (
|
||||||
|
app.config.PACKAGE_CHECK_DIR + "summary_{worker_id}.png"
|
||||||
)
|
)
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
def main():
|
if not os.path.exists(app.config.PACKAGE_CHECK_PATH):
|
||||||
|
print(
|
||||||
|
f"Error: analyzer script doesn't exist at '{app.config.PACKAGE_CHECK_PATH}'. Please fix the configuration in {config}"
|
||||||
|
)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if app.config.MONITOR_APPS_LIST:
|
if app.config.MONITOR_APPS_LIST:
|
||||||
app.add_task(
|
app.add_task(
|
||||||
monitor_apps_lists(
|
monitor_apps_lists(
|
||||||
|
|
Loading…
Add table
Reference in a new issue