1
0

fixing my booboo and now know what istable

This commit is contained in:
tbelway 2025-10-28 13:48:29 -04:00
parent 58cbc94a51
commit fd7d6b4178

View File

@ -95,6 +95,7 @@ get_parameters() {
if [[ -z $FOUNDRY_URL ]]; then
echo "Need the foundry URL, please try again..."
latest_stable_foundry
exit 1
fi
@ -125,7 +126,7 @@ get_parameters() {
fi
if [[ -z $OPT_VERSION ]]; then
OPT_VERSION="12.331"
OPT_VERSION="latest"
fi
if [[ "${OPT_SCHEDULED}" == "TRUE" ]]; then
@ -143,6 +144,9 @@ TAG="$OPT_VERSION"
# Build Functions
container_initialize() {
if [[ "$OPT_VERSION" == "latest" ]]; then
OPT_VERSION="${STABLE[0]}"
fi
echo "Initializing container build..."
podman login ${REGISTRY}
podman build -f ${OPT_CONTAINERFILE} -t ${REGISTRY}/${REGISTRY_NAMESPACE}:${TAG} -t ${REGISTRY}/${REGISTRY_NAMESPACE}:latest --build-arg foundry_url=${FOUNDRY_URL} --build-arg nodejs_version=${NODEJS_VERSION}
@ -154,7 +158,7 @@ container_initialize() {
container_scheduled_build() {
echo "Scheduled build starting..."
if [[ "${CADDY_IMAGE_VERSION}" != "${CUSTOM_CADDY_IMAGE_VERSION}" ]]; then
if [[ "${CADDY_IMAGE_VERSION}" != "${STABLE[0]}" ]]; then
podman login ${REGISTRY}
podman build -f ${OPT_CONTAINERFILE} -t ${REGISTRY}/${REGISTRY_NAMESPACE}:${TAG} -t ${REGISTRY}/${REGISTRY_NAMESPACE}:latest --build-arg foundry_url=${FOUNDRY_URL}
podman push ${REGISTRY}/${REGISTRY_NAMESPACE}:${TAG}
@ -177,11 +181,23 @@ container_rebuild() {
echo "Rebuild complete!"
}
latest_stable_foundry() {
RELEASES=" $(curl https://foundryvtt.com/releases/)"
for i in $( echo "${RELEASES}" | cut -d "=" -f 3 | grep Release | cut -d " " -f 2 | grep -v class | sort -nr); do
if [[ $(echo "${RELEASES}" | grep -A 6 "${i}" | grep -i stable) ]]; then
STABLE+=(${i})
fi
done
echo "Latest stable is: ${STABLE[0]}"
}
###############################################################################################################################
# Main Script
###############################################################################################################################
get_parameters "$@"
latest_stable_foundry
if [[ "$OPT_SCHEDULED" == "TRUE" ]]; then
container_scheduled_build
fi