]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
build-with-container.py: Add --env-file
authorZack Cerza <zack@cerza.org>
Sat, 8 Feb 2025 00:16:20 +0000 (17:16 -0700)
committerZack Cerza <zack@cerza.org>
Wed, 5 Mar 2025 20:39:27 +0000 (13:39 -0700)
Signed-off-by: Zack Cerza <zack@cerza.org>
src/script/build-with-container.py

index 82f892924cb521bcb9255aee760c3f246f5def6a..5f8fcd489466ecf560ce2ac0792d2ddef1abdeaa 100755 (executable)
@@ -179,6 +179,8 @@ def _container_cmd(ctx, args, *, workdir=None, interactive=False):
         cmd.append("--pids-limit=-1")
     if ctx.map_user:
         cmd.append("--user=0")
+    if ctx.cli.env_file:
+        cmd.append(f"--env-file={ctx.cli.env_file.absolute()}")
     if workdir:
         cmd.append(f"--workdir={workdir}")
     cwd = pathlib.Path(".").absolute()
@@ -844,6 +846,11 @@ def parse_cli(build_step_names):
         choices=build_step_names,
         help="Execute the target build step(s)",
     )
+    parser.add_argument(
+        "--env-file",
+        type=pathlib.Path,
+        help="Use this environment file when building",
+    )
     parser.add_argument(
         "--dry-run",
         action="store_true",