build(bot): 🔨 Add updating and deployment scripts.

This commit is contained in:
Nyeki.py
2024-11-03 13:32:45 -03:00
parent edb8ad65c7
commit 2f33d9610c
4 changed files with 58 additions and 16 deletions
+22
View File
@@ -0,0 +1,22 @@
import os
import sys
try:
import toml
except ImportError:
print(
"You need to install `toml` to use this file. Run `pip install toml` and try again."
)
sys.exit()
version = toml.load(open("pyproject.toml"))["project"]["version"].split(".")[1]
os.system("git pull")
os.system(f"kubectl set image sts/bot bot=git.nyeki.dev/payphone/payphone-shard:v{version}")
os.system(f"""
kubectl set image deploy/tasks \
flush=git.nyeki.dev/payphone/payphone-shard:v{version} \
delete-accounts=git.nyeki.dev/payphone/payphone-shard:v{version} \
hangup-inactive-calls=git.nyeki.dev/payphone/payphone-shard:v{version}
""")