generated from blue-build/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-isos
executable file
·34 lines (31 loc) · 1014 Bytes
/
build-isos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
## https://devhints.io/bash
set -euo pipefail # strict
IFS=$'\n\t'
if ! command -v bluebuild >/dev/null; then
echo "bluebuild CLI not found."
exit 1
fi
if [ "$EUID" -ne 0 ]; then
sudo $0
exit $?
fi
outdir=./isos
mkdir -p "$outdir"
RECIPES=()
here="$PWD"
cd recipes
today=$(date -I)
RECIPES+=(recipe-*.yml)
for recipe in "${RECIPES[@]}"; do
image="${recipe#recipe-}"
image="${image%.yml}"
cd "$here"
if bluebuild generate "recipes/$recipe" --output "$outdir/$image-$today".yaml --display-full-recipe &&
bluebuild generate "recipes/$recipe" --output "$outdir/$image-$today".Containerfile &&
bluebuild generate-iso -V kinoite --output-dir "$outdir" --iso-name "$image-$today".iso image ghcr.io/omegasquad82/"$image"; then
echo "$(ls "$outdir/$image-$today".{iso,Containerfile,yaml}) => rendered from $recipe and ostree-image-signed:docker://$image"
else
echo "ostree-image-signed:docker://$image from $recipe could not be turned into {iso,Containerfile,yaml} formats"
fi
done