Skip to content

Commit

Permalink
test/test_build: add local flag
Browse files Browse the repository at this point in the history
Enable ability to build local images
  • Loading branch information
kingsleyzissou committed Mar 11, 2024
1 parent 192213b commit f0d7fba
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,24 @@ def build_images(shared_tmpdir, build_container, request, force_aws_upload):
"--privileged",
"--security-opt", "label=type:unconfined_t",
"-v", f"{output_path}:/output",
"-v", "/store", # share the cache between builds
"-v", "/store",
]

# we need to mount the host's container store
if local:
cmd.extend(["-v", "/var/lib/containers/storage:/var/lib/containers/storage"])

cmd.extend([
*creds_args,
build_container,
container_ref,
"--config", "/output/config.json",
*types_arg,
*upload_args,
*target_arch_args,
]
"--local" if local else "--local=false",
])

# print the build command for easier tracing
print(" ".join(cmd))
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
Expand Down

0 comments on commit f0d7fba

Please sign in to comment.