bootc-base-imagectl: support hidden manifests, hide minimal-plus
We don't currently want the minimal-plus target to be user-facing. It's intended only for other Fedora variants. Let's support "hidden" manifests by having their names end in `.hidden.yaml`. Then, make `minimal-plus` hidden. I considered instead having them start with `.` to match well-established semantics, but I don't like either that this hides them from an `ls` in the git repo (or even with `-a`, puts them higher up whereas I want it to be close to `minimal.yaml`). I also considered leveraging the existing symlink hiding semantics, but it also felt awkward to rename a file and add a symlink to it just for the purpose of hiding it.
This commit is contained in:
parent
c2ff52a7cf
commit
87eae9910e
12 changed files with 21 additions and 12 deletions
|
|
@ -10,7 +10,7 @@ metadata:
|
||||||
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
||||||
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
|
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
|
||||||
== "main" && ( "./iot.yaml".pathChanged() || "./iot/***".pathChanged()
|
== "main" && ( "./iot.yaml".pathChanged() || "./iot/***".pathChanged()
|
||||||
|| "./minimal-plus.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|
|| "./minimal-plus.hidden.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|
||||||
|| "./minimal.yaml".pathChanged() || "./minimal/***".pathChanged() ||
|
|| "./minimal.yaml".pathChanged() || "./minimal/***".pathChanged() ||
|
||||||
"./fedora-includes/generic.yaml".pathChanged() || ".tekton/fedora-bootc-42-iot-pull-request.yaml".pathChanged()
|
"./fedora-includes/generic.yaml".pathChanged() || ".tekton/fedora-bootc-42-iot-pull-request.yaml".pathChanged()
|
||||||
|| "Containerfile".pathChanged() )
|
|| "Containerfile".pathChanged() )
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ metadata:
|
||||||
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
||||||
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
|
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
|
||||||
== "main" && ( "./iot.yaml".pathChanged() || "./iot/***".pathChanged()
|
== "main" && ( "./iot.yaml".pathChanged() || "./iot/***".pathChanged()
|
||||||
|| "./minimal-plus.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|
|| "./minimal-plus.hidden.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|
||||||
|| "./minimal.yaml".pathChanged() || "./minimal/***".pathChanged() ||
|
|| "./minimal.yaml".pathChanged() || "./minimal/***".pathChanged() ||
|
||||||
"./fedora-includes/generic.yaml".pathChanged() || ".tekton/fedora-bootc-42-iot-push.yaml".pathChanged()
|
"./fedora-includes/generic.yaml".pathChanged() || ".tekton/fedora-bootc-42-iot-push.yaml".pathChanged()
|
||||||
|| "Containerfile".pathChanged() )
|
|| "Containerfile".pathChanged() )
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ metadata:
|
||||||
pipelinesascode.tekton.dev/cancel-in-progress: "true"
|
pipelinesascode.tekton.dev/cancel-in-progress: "true"
|
||||||
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
||||||
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
|
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
|
||||||
== "main" && ( "./minimal-plus.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
|
== "main" && ( "./minimal-plus.hidden.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
|
||||||
|| "./minimal-plus/***".pathChanged() || ".tekton/fedora-bootc-42-minimal-plus-pull-request.yaml".pathChanged()
|
|| "./minimal-plus/***".pathChanged() || ".tekton/fedora-bootc-42-minimal-plus-pull-request.yaml".pathChanged()
|
||||||
|| "Containerfile".pathChanged() )
|
|| "Containerfile".pathChanged() )
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ metadata:
|
||||||
pipelinesascode.tekton.dev/cancel-in-progress: "false"
|
pipelinesascode.tekton.dev/cancel-in-progress: "false"
|
||||||
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
||||||
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
|
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
|
||||||
== "main" && ( "./minimal-plus.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
|
== "main" && ( "./minimal-plus.hidden.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
|
||||||
|| "./minimal-plus/***".pathChanged() || ".tekton/fedora-bootc-42-minimal-plus-push.yaml".pathChanged()
|
|| "./minimal-plus/***".pathChanged() || ".tekton/fedora-bootc-42-minimal-plus-push.yaml".pathChanged()
|
||||||
|| "Containerfile".pathChanged() )
|
|| "Containerfile".pathChanged() )
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ metadata:
|
||||||
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
||||||
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
|
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
|
||||||
== "main" && ( "./iot.yaml".pathChanged() || "./iot/***".pathChanged()
|
== "main" && ( "./iot.yaml".pathChanged() || "./iot/***".pathChanged()
|
||||||
|| "./minimal-plus.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|
|| "./minimal-plus.hidden.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|
||||||
|| "./minimal.yaml".pathChanged() || "./minimal/***".pathChanged() ||
|
|| "./minimal.yaml".pathChanged() || "./minimal/***".pathChanged() ||
|
||||||
"./fedora-includes/generic.yaml".pathChanged() || ".tekton/fedora-bootc-rawhide-iot-pull-request.yaml".pathChanged()
|
"./fedora-includes/generic.yaml".pathChanged() || ".tekton/fedora-bootc-rawhide-iot-pull-request.yaml".pathChanged()
|
||||||
|| "Containerfile".pathChanged() )
|
|| "Containerfile".pathChanged() )
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ metadata:
|
||||||
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
||||||
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
|
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
|
||||||
== "main" && ( "./iot.yaml".pathChanged() || "./iot/***".pathChanged()
|
== "main" && ( "./iot.yaml".pathChanged() || "./iot/***".pathChanged()
|
||||||
|| "./minimal-plus.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|
|| "./minimal-plus.hidden.yaml".pathChanged() || "./minimal-plus/***".pathChanged()
|
||||||
|| "./minimal.yaml".pathChanged() || "./minimal/***".pathChanged() ||
|
|| "./minimal.yaml".pathChanged() || "./minimal/***".pathChanged() ||
|
||||||
"./fedora-includes/generic.yaml".pathChanged() || ".tekton/fedora-bootc-rawhide-iot-push.yaml".pathChanged()
|
"./fedora-includes/generic.yaml".pathChanged() || ".tekton/fedora-bootc-rawhide-iot-push.yaml".pathChanged()
|
||||||
|| "Containerfile".pathChanged() )
|
|| "Containerfile".pathChanged() )
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ metadata:
|
||||||
pipelinesascode.tekton.dev/cancel-in-progress: "true"
|
pipelinesascode.tekton.dev/cancel-in-progress: "true"
|
||||||
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
||||||
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
|
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
|
||||||
== "main" && ( "./minimal-plus.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
|
== "main" && ( "./minimal-plus.hidden.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
|
||||||
|| "./minimal-plus/***".pathChanged() || ".tekton/fedora-bootc-rawhide-minimal-plus-pull-request.yaml".pathChanged()
|
|| "./minimal-plus/***".pathChanged() || ".tekton/fedora-bootc-rawhide-minimal-plus-pull-request.yaml".pathChanged()
|
||||||
|| "Containerfile".pathChanged() )
|
|| "Containerfile".pathChanged() )
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ metadata:
|
||||||
pipelinesascode.tekton.dev/cancel-in-progress: "false"
|
pipelinesascode.tekton.dev/cancel-in-progress: "false"
|
||||||
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
||||||
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
|
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
|
||||||
== "main" && ( "./minimal-plus.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
|
== "main" && ( "./minimal-plus.hidden.yaml".pathChanged() || "./fedora-includes/generic.yaml".pathChanged()
|
||||||
|| "./minimal-plus/***".pathChanged() || ".tekton/fedora-bootc-rawhide-minimal-plus-push.yaml".pathChanged()
|
|| "./minimal-plus/***".pathChanged() || ".tekton/fedora-bootc-rawhide-minimal-plus-push.yaml".pathChanged()
|
||||||
|| "Containerfile".pathChanged() )
|
|| "Containerfile".pathChanged() )
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,12 @@ def run_build_rootfs(args):
|
||||||
Regenerates a base image using a build configuration.
|
Regenerates a base image using a build configuration.
|
||||||
"""
|
"""
|
||||||
target = args.target
|
target = args.target
|
||||||
manifest_path = f'/{MANIFESTDIR}/{args.manifest}.yaml'
|
for fn in [f'{args.manifest}.yaml', f'{args.manifest}.hidden.yaml']:
|
||||||
|
manifest_path = f'/{MANIFESTDIR}/{fn}'
|
||||||
|
if os.path.exists(manifest_path):
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise Exception(f"manifest not found: {args.manifest}")
|
||||||
|
|
||||||
rpmostree_argv = ['rpm-ostree', 'compose', 'rootfs']
|
rpmostree_argv = ['rpm-ostree', 'compose', 'rootfs']
|
||||||
|
|
||||||
|
|
@ -116,7 +121,7 @@ def run_list(args):
|
||||||
d = '/' + MANIFESTDIR
|
d = '/' + MANIFESTDIR
|
||||||
for ent in sorted(os.listdir(d)):
|
for ent in sorted(os.listdir(d)):
|
||||||
name, ext = os.path.splitext(ent)
|
name, ext = os.path.splitext(ent)
|
||||||
if ext != '.yaml':
|
if ext != '.yaml' or name.endswith('.hidden'):
|
||||||
continue
|
continue
|
||||||
fullpath = os.path.join(d, ent)
|
fullpath = os.path.join(d, ent)
|
||||||
if os.path.islink(fullpath):
|
if os.path.islink(fullpath):
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
minimal-plus.yaml
|
minimal-plus.hidden.yaml
|
||||||
|
|
@ -8,7 +8,11 @@ for image in minimal standard minimal-plus iot; do
|
||||||
# Embed the generic defaults
|
# Embed the generic defaults
|
||||||
cp -a $image $manifestdir/
|
cp -a $image $manifestdir/
|
||||||
# And the top-level Fedora-specific manifests
|
# And the top-level Fedora-specific manifests
|
||||||
cp -a $image.yaml $manifestdir/
|
if [ -f $image.hidden.yaml ]; then
|
||||||
|
cp -a $image.hidden.yaml $manifestdir/
|
||||||
|
else
|
||||||
|
cp -a $image.yaml $manifestdir/
|
||||||
|
fi
|
||||||
# And the legacy `fedora-` prefixed names
|
# And the legacy `fedora-` prefixed names
|
||||||
cp -a fedora-$image.yaml $manifestdir/
|
cp -a fedora-$image.yaml $manifestdir/
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue