tubearchivist-server/tubearchivist/web/src/webhook_base.py

41 lines
1.6 KiB
Python
Raw Normal View History

2022-05-20 04:41:44 +00:00
"""base class to handle webhook config"""
from os import environ
class WebhookBase:
"""shared config"""
# map key is gh_repo name
HOOK_MAP = {
2022-05-20 10:59:20 +00:00
"tubearchivist": {
2022-05-20 04:41:44 +00:00
"gh_user": "tubearchivist",
2022-05-20 10:59:20 +00:00
"gh_repo": "tubearchivist",
2022-05-20 04:41:44 +00:00
"docker_user": "bbilly1",
2022-05-20 10:59:20 +00:00
"docker_repo": "tubearchivist",
2022-05-20 04:41:44 +00:00
"unstable_keyword": "#build",
"build_unstable": [
2022-05-20 10:59:20 +00:00
"build", "--platform", "linux/amd64",
"-t", "bbilly1/tubearchivist:unstable", "--push"
2022-05-20 04:41:44 +00:00
],
"build_release": [
"build", "--platform", "linux/amd64,linux/arm64",
2022-05-20 10:59:20 +00:00
"-t", "bbilly1/tubearchivist",
"-t", "bbilly1/tubearchivist:unstable",
"-t", "bbilly1/tubearchivist:$VERSION", "--push"
2022-05-20 04:41:44 +00:00
],
"sync_es": [
2022-07-03 12:21:46 +00:00
["docker", "image", "pull", "elasticsearch:$VERSION"],
["docker", "tag", "elasticsearch:$VERSION", "bbilly1/tubearchivist-es"],
["docker", "tag", "elasticsearch:$VERSION", "bbilly1/tubearchivist-es:$VERSION"],
["docker", "push", "bbilly1/tubearchivist-es"],
["docker", "push", "bbilly1/tubearchivist-es:$VERSION"],
],
2022-05-20 10:59:20 +00:00
"discord_unstable_hook": environ.get("DOCKER_UNSTABLE_HOOK_URL"),
"discord_release_hook": environ.get("GITHUB_RELEASE_HOOK_URL"),
2022-05-20 04:41:44 +00:00
}
}
ROADMAP_HOOK_URL = environ.get("ROADMAP_HOOK_URL")
GH_HOOK_SECRET = environ.get("GH_HOOK_SECRET")
DOCKER_HOOK_SECRET = environ.get("DOCKER_HOOK_SECRET")