Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions test/bin/ci_phase_iso_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ update_build_cache() {
# Build templates
$(dry_run) bash -x ./bin/build_bootc_images.sh -g ./image-blueprints-bootc/templates
# Build the bootc base layer and brew RPMs to be cached
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer1-base
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer4-release
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base -l ./image-blueprints-bootc/el10/layer1-base
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer4-release -l ./image-blueprints-bootc/el10/layer4-release

# Prepare for the cache upload by stopping composer services and cleaning
# temporary artifacts
Expand Down Expand Up @@ -132,31 +132,33 @@ run_bootc_image_build() {

if [[ "${os}" == "el9" || "${os}" == "el10" ]]; then

$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer1-base
$(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os}/layer1-base"
$(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os}/layer2-presubmit"

if [[ "${os}" == "el10" ]]; then
# Build el9 images for upgrade tests
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer2-presubmit
fi

if [[ "${CI_JOB_NAME}" =~ .*periodic.* ]]; then
$(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os}/layer3-periodic"
fi
if [[ "${CI_JOB_NAME}" =~ .*release.* ]]; then
$(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os}/layer4-release"
fi
fi

# Build upstream images
if [[ "${CI_JOB_NAME}" =~ .*upstream.* ]]; then
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/upstream
fi
else
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer1-base
# Full build for all OS versions
for os_ver in el9 el10; do
$(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer2-presubmit"
$(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer3-periodic"
done
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer4-release
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base -l ./image-blueprints-bootc/el10/layer1-base
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer2-presubmit -l ./image-blueprints-bootc/el10/layer2-presubmit
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer3-periodic -l ./image-blueprints-bootc/el10/layer3-periodic
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer4-release -l ./image-blueprints-bootc/el10/layer4-release
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/upstream
fi
}
Expand Down
21 changes: 13 additions & 8 deletions test/bin/pyutils/build_bootc_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def main():
choices=["image-bootc", "containerfile", "container-encapsulate"],
help="Only build images of the specified type.")
dirgroup = parser.add_mutually_exclusive_group(required=False)
dirgroup.add_argument("-l", "--layer-dir", type=str, help="Path to the layer directory to process.")
dirgroup.add_argument("-l", "--layer-dir", action="append", default=[], help="Path to the layer directory to process. Can be specified multiple times.")
dirgroup.add_argument("-g", "--group-dir", type=str, help="Path to the group directory to process.")
dirgroup.add_argument("-t", "--template", type=str, help="Path to a template to build. Allows glob patterns (requires double qoutes).")

Expand All @@ -600,8 +600,12 @@ def main():
args.group_dir = os.path.abspath(args.group_dir)
dir2process = args.group_dir
if args.layer_dir:
args.layer_dir = os.path.abspath(args.layer_dir)
dir2process = args.layer_dir
# Convert input layer directories to absolute paths
args.layer_dir = [os.path.abspath(d) for d in args.layer_dir]
# Validate each layer directory exists
for layer_dir in args.layer_dir:
if not os.path.isdir(layer_dir):
raise Exception(f"The layer directory '{layer_dir}' does not exist")
if args.template:
args.template = os.path.abspath(args.template)
dir2process = os.path.dirname(args.template)
Expand Down Expand Up @@ -672,11 +676,12 @@ def main():
PULL_SECRET = opull_secret
# Process layer directory contents sorted by length and then alphabetically
if args.layer_dir:
for item in sorted(os.listdir(args.layer_dir), key=lambda i: (len(i), i)):
item_path = os.path.join(args.layer_dir, item)
# Check if this item is a directory
if os.path.isdir(item_path):
process_group(item_path, args.build_type, dry_run=args.dry_run)
for layer_dir in args.layer_dir:
for item in sorted(os.listdir(layer_dir), key=lambda i: (len(i), i)):
item_path = os.path.join(layer_dir, item)
# Check if this item is a directory
if os.path.isdir(item_path):
process_group(item_path, args.build_type, dry_run=args.dry_run)
else:
# Process individual group directory or template
process_group(dir2process, args.build_type, pattern, args.dry_run)
Expand Down