Skip to content

Commit

Permalink
Fix build command for Rancher Desktop
Browse files Browse the repository at this point in the history
Fix error introduced in PR #1677.  Previous implementation used
os.system which takes a string.  #1677 changed to use subprocess.run
which takes a List.  When building for Rancher Desktop, the namespace
was part of the build_cmd string instead of separate elements in the
list.
  • Loading branch information
jmgrady committed Jul 30, 2022
1 parent 5e5d7cc commit a8f8ffc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions deploy/scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ def main() -> None:
logging.basicConfig(format="%(levelname)s:%(message)s", level=log_level)

if args.nerdctl:
build_cmd = f"nerdctl -n {args.namespace}"
build_cmd = ["nerdctl", "-n", args.namespace]
else:
build_cmd = "docker"
build_cmd = ["docker"]

if args.components is not None:
to_do = args.components
Expand All @@ -120,13 +120,13 @@ def main() -> None:
logging.info(f"Building component {component}")
print_all = args.output_level == "all"
run_cmd(
[build_cmd, "build", "-t", image_name, "-f", "Dockerfile", "."],
build_cmd + ["build", "-t", image_name, "-f", "Dockerfile", "."],
print_cmd=print_all,
print_output=print_all,
)
logging.info(f"{component} build complete")
if args.repo is not None:
run_cmd([build_cmd, "push", image_name])
run_cmd(build_cmd + ["push", image_name])
logging.info(f"{image_name} pushed to {args.repo}")

# Remove the version file
Expand Down

0 comments on commit a8f8ffc

Please sign in to comment.