From c32585f73860e36dc3173b46edfa0c9c7a1e765d Mon Sep 17 00:00:00 2001 From: Rafael Bradley Date: Tue, 18 Mar 2025 13:30:41 -0300 Subject: [PATCH] feat(scripts): :sparkles: Use git's credential store instead of prompting for username and password. --- scripts/deploy.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/deploy.py b/scripts/deploy.py index bd60a25..e304b75 100644 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -1,6 +1,6 @@ import os +import sys import time -import getpass try: import toml @@ -20,12 +20,9 @@ except ImportError: ) sys.exit() -username = input("Username for git.nyeki.dev: ") -password = getpass.getpass("Password for git.nyeki.dev: ") +os.system("git pull") -os.system(f"git pull https://{username}:{password}@git.nyeki.dev/payphone/payphone") - -data = toml.load(open("pyproject.toml")) +data = toml.load(open("pyproject.toml", encoding="utf-8")) version = data["project"]["version"].split(".") latest_tag = "v" + version[1] @@ -43,7 +40,7 @@ print("Waiting 15 seconds to run migrations...") time.sleep(15) -with open("./k8s/bot.yml") as stream: +with open("./k8s/bot.yml", encoding="utf-8") as stream: try: docs = list(yaml.load_all(stream, yaml.Loader)) data = docs[0]