Never let git prompt

This commit is contained in:
Thomas E Lackey 2023-12-21 17:51:49 -06:00
parent 44fa85bdf0
commit a96d6726ad

View File

@ -207,9 +207,11 @@ def build_container_image(app_record, tag, extra_build_args=[]):
print(f"Cloning repository {repo} to {clone_dir} ...") print(f"Cloning repository {repo} to {clone_dir} ...")
if ref: if ref:
# TODO: Determing branch or hash, and use depth 1 if we can. # TODO: Determing branch or hash, and use depth 1 if we can.
result = subprocess.run(["git", "clone", repo, clone_dir]) git_env = dict(os.environ.copy())
result.check_returncode() # Never prompt
subprocess.check_call(["git", "checkout", ref], cwd=clone_dir) git_env["GIT_TERMINAL_PROMPT"] = "0"
subprocess.check_call(["git", "clone", repo, clone_dir], env=git_env)
subprocess.check_call(["git", "checkout", ref], cwd=clone_dir, env=git_env)
else: else:
result = subprocess.run(["git", "clone", "--depth", "1", repo, clone_dir]) result = subprocess.run(["git", "clone", "--depth", "1", repo, clone_dir])
result.check_returncode() result.check_returncode()