]> 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, 24 Jul 2025 13:55:05 +0000 (09:55 -0400)
Signed-off-by: Zack Cerza <zack@cerza.org>
(cherry picked from commit 8e9544fed3dc70ac91f995aacb3aed2edbd45554)

src/script/build-with-container.py

index b3c0b649584426ce04c740f9e685d291e77e2c05..b813ee9ba52eb171a016a02b0e6f24d0df72db80 100755 (executable)
@@ -194,6 +194,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()
@@ -859,6 +861,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",