Add new check for integrations in BunkerNet job

This commit is contained in:
Théophile Diot 2023-04-18 15:44:35 +02:00
parent 707256076a
commit 9a325c7a9a
No known key found for this signature in database
GPG Key ID: E752C80DB72BB014
1 changed files with 8 additions and 4 deletions

View File

@ -62,13 +62,17 @@ def get_integration():
try:
if getenv("AUTOCONF_MODE") == "yes":
return "autoconf"
if getenv("SWARM_MODE") == "yes":
elif getenv("SWARM_MODE") == "yes":
return "swarm"
elif getenv("KUBERNETES_MODE") == "yes":
return "kubernetes"
elif Path("/usr/share/bunkerweb/INTEGRATION").exists():
with open("/usr/share/bunkerweb/INTEGRATION", "r") as f:
return f.read().strip().lower()
elif Path("/usr/share/bunkerweb/INTEGRATION").is_file():
return Path("/usr/share/bunkerweb/INTEGRATION").read_text().strip().lower()
elif (
Path("/etc/os-release").is_file()
and "Alpine" in Path("/etc/os-release").read_text()
):
return "docker"
return "linux"
except: