Updates for 9.0 support and usability

- Add automatic ISO filename switching based on major version
- Update usage information to include package-set
- Automatically reload FIF templates prior to test run
- Update build name to display chronologically on openQA landing page
This commit is contained in:
Al Bowles 2022-10-14 19:28:29 -05:00
parent 0aebbb75a4
commit 4e0507bac1
No known key found for this signature in database
GPG Key ID: 9B42314A30F1A3D1

View File

@ -1,36 +1,48 @@
#!/bin/bash #!/bin/bash
set -e set -e
MAJOR_VERSION=8
MINOR_VERSION=6
ROCKY_FLAVOR="${ROCKY_FLAVOR:-boot-iso}" ROCKY_FLAVOR="${ROCKY_FLAVOR:-boot-iso}"
ROCKY_VERSION="${ROCKY_VERSION:-8.6}" ROCKY_VERSION="$MAJOR_VERSION.$MINOR_VERSION"
ROCKY_ARCH="${ROCKY_ARCH:=x86_64}" ROCKY_ARCH="${ROCKY_ARCH:=x86_64}"
ROCKY_PACKAGE_SET="${ROCKY_PACKAGE_SET:=minimal}"
ROCKY_EXTRA_ARGS="${ROCKY_EXTRA_ARGS:-}" ROCKY_EXTRA_ARGS="${ROCKY_EXTRA_ARGS:-}"
BUILD_PREFIX="${ROCKY_VERSION}_${ROCKY_FLAVOR}" BUILD_PREFIX="-$(date +%Y%m%d.%H%M%S).0-$(git branch --show-current)"
BUILD_NAME="${BUILD_PREFIX}_$(date +%Y%m%d.%H%M%S).0" BUILD_NAME="$BUILD_PREFIX-$ROCKY_FLAVOR-$ROCKY_VERSION"
ISO_PREFIX="Rocky-$ROCKY_VERSION-$ROCKY_ARCH"
if [[ "$ROCKY_FLAVOR" == "dvd-iso" || "$ROCKY_FLAVOR" == "universal" ]]; then if [[ "$ROCKY_FLAVOR" == "dvd-iso" || "$ROCKY_FLAVOR" == "universal" ]]; then
ISO_TYPE=dvd1 if [[ "$MAJOR_VERSION" -gt "8" ]]; then
ISO_TYPE=dvd
else
ISO_TYPE=dvd1
fi
elif [[ "$ROCKY_FLAVOR" == "minimal-iso" ]]; then elif [[ "$ROCKY_FLAVOR" == "minimal-iso" ]]; then
ISO_TYPE=minimal ISO_TYPE=minimal
elif [[ "$ROCKY_FLAVOR" == "boot-iso" ]]; then elif [[ "$ROCKY_FLAVOR" == "boot-iso" || "$ROCKY_FLAVOR" == "package-set" ]]; then
# package-set also works with dvd image
ISO_TYPE=boot ISO_TYPE=boot
else else
echo "Usage: $0 [universal|dvd-iso|minimal-iso|boot-iso]" echo "Usage: $0 [universal|dvd-iso|minimal-iso|package-set|boot-iso]"
exit 1 exit 1
fi fi
ROCKY_ISO="$ISO_PREFIX-$ISO_TYPE.iso"
# Update fif templates
./fifloader.py --clean --load templates.fif.json templates-updates.fif.json
# Run the tests
export PS4='# ' export PS4='# '
set -o xtrace set -o xtrace
openqa-cli api \ openqa-cli api \
-X POST isos \ -X POST isos \
ISO="Rocky-$ROCKY_VERSION-$ROCKY_ARCH-$ISO_TYPE.iso" \ ISO="$ROCKY_ISO" \
ARCH="$ROCKY_ARCH" \ ARCH="$ROCKY_ARCH" \
DISTRI=rocky \ DISTRI=rocky \
FLAVOR="$ROCKY_FLAVOR" \ FLAVOR="$ROCKY_FLAVOR" \
VERSION="$ROCKY_VERSION" \ VERSION="$ROCKY_VERSION" \
BUILD="$BUILD_NAME" \ BUILD="$BUILD_NAME" \
PACKAGE_SET="$ROCKY_PACKAGE_SET" \ "$ROCKY_EXTRA_ARGS"
IDENTIFICATION=false \
"${ROCKY_EXTRA_ARGS}"