]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerDavid Galloway <david.galloway@ibm.com>
Thu, 31 Jul 2025 21:57:04 +0000 (17:57 -0400)
Signed-off-by: Zack Cerza <zack@cerza.org>
(cherry picked from commit 8e9544fed3dc70ac91f995aacb3aed2edbd45554)

src/script/build-with-container.py

index d22e20b1e0494c0893e66272795ff053a45a9e53..914b22b39c0d72f5958e6a7b549d24e1b49c6b5b 100755 (executable)
@@ -195,6 +195,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()
@@ -930,6 +932,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",