Demo about Edge Computing in the Retail vertical using Red Hat products
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

28 lines
822 B

#!/bin/bash
set -Eeuo pipefail
if [[ "$UID" -ne 0 ]]; then
echo "This command must be run as root!"
exit 1
fi
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
. "$PROJECT_DIR/config.env"
for dir in "$PROJECT_DIR"/{base,baremetal,virtualmachine}; do
if [ -d "$dir" -a -f "$dir/Containerfile" ]; then
export SCENARIO="${dir##*/}"
TARGET_IMAGE="$(echo -n "$TARGET_IMAGE_TEMPLATE" | envsubst)"
echo "Building container image $TARGET_IMAGE from $SCENARIO..."
pushd "$dir" > /dev/null
"$SCRIPT_DIR/build-image.sh" "$TARGET_IMAGE"
if [[ "$SCENARIO" == "virtualmachine" ]]; then
echo "Building qcow2 image for $TARGET_IMAGE..."
"$SCRIPT_DIR/build-qcow2.sh" "$TARGET_IMAGE"
fi
popd > /dev/null
fi
done