toolkit/mangle/generators/oval.sh
Louis Abel 7d54ace28e
Some checks failed
Build empanada images for imagefactory / buildx (push) Failing after 4s
Build empanada container images for lorax / buildx (push) Successful in 1s
mangle: oval.sh contains a broken podman command
2024-05-10 01:36:29 -07:00

33 lines
932 B
Bash

#!/bin/bash
log(){
printf "[LOG] [%s] %s\n" "$(date -Is)" "$1"
}
OUTPUT_DIR=/mnt/repos-staging/mirror/pub/oval
TEMP="$(mktemp -d)"
for version in 8 9; do
file="$TEMP/org.rockylinux.rlsa-$version.xml"
log "Generating $file"
#podman run --rm --storage-opt ignore_chown_errors=true ghcr.io/rocky-linux/oval:latest -- $version > "$file"
# The above reports an error when running on R8. The below may *not* work on anything else.
# TODO: verify this is the case.
podman run --rm --storage-opt ignore_chown_errors=true ghcr.io/rocky-linux/oval:latest $version > "$file"
log "Compressing $file to $file.bz"
bzip2 -kfz "$file"
done
log "Generating checksums"
pushd "$TEMP" >/dev/null || exit 2
# shellcheck disable=2035
sha256sum --tag * > CHECKSUM
popd > /dev/null || exit 2
log "Copying to staging directory $TEMP => $OUTPUT_DIR"
sudo rsync -vrSHP "$TEMP/" "$OUTPUT_DIR"
sudo chown -Rv 10004:10005 "$OUTPUT_DIR"