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} """)