build(bot): 🔨 Add updating and deployment scripts.
This commit is contained in:
@@ -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}
|
||||
""")
|
||||
Reference in New Issue
Block a user