From 657debfc8d0a7d5a1630fee26c8bb79c7f62aacf Mon Sep 17 00:00:00 2001 From: VetheonGames Date: Tue, 25 Jun 2024 08:27:33 -0600 Subject: [PATCH] add auto-builder and modify entrypoint to fix shellcheck warn --- .../Minecraft-Paper/auto-builder.sh | 26 +++++++++++++++++++ .../Minecraft-Paper/entrypoint.sh | 6 ++--- 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 PterodactylImages/Minecraft-Paper/auto-builder.sh diff --git a/PterodactylImages/Minecraft-Paper/auto-builder.sh b/PterodactylImages/Minecraft-Paper/auto-builder.sh new file mode 100644 index 0000000..0525912 --- /dev/null +++ b/PterodactylImages/Minecraft-Paper/auto-builder.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# DockerHub username +DOCKERHUB_USERNAME="vetheon" + +# Array of Java versions +JAVA_VERSIONS=("8" "11" "16" "17" "18" "19" "20" "21" "22") + +# Base path to Dockerfiles +BASE_PATH="./DockerImages/PterodactylImages/Minecraft-Paper/Ridged-Java" + +# Loop through each Java version, build, tag, and push the Docker images +for VERSION in "${JAVA_VERSIONS[@]}"; do + IMAGE_NAME="${DOCKERHUB_USERNAME}/pterodactyl-images:java_${VERSION}" + DOCKERFILE_PATH="${BASE_PATH}/${VERSION}/Dockerfile" + + # Build the Docker image + echo "Building Docker image for Java ${VERSION}..." + docker build -t "${IMAGE_NAME}" -f "${DOCKERFILE_PATH}" . + + # Push the Docker image to DockerHub + echo "Pushing Docker image for Java ${VERSION} to DockerHub..." + docker push "${IMAGE_NAME}" +done + +echo "All images have been built and pushed successfully." diff --git a/PterodactylImages/Minecraft-Paper/entrypoint.sh b/PterodactylImages/Minecraft-Paper/entrypoint.sh index f3550b0..8e475b4 100644 --- a/PterodactylImages/Minecraft-Paper/entrypoint.sh +++ b/PterodactylImages/Minecraft-Paper/entrypoint.sh @@ -13,10 +13,8 @@ INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') export INTERNAL_IP # Replace Startup Variables -# shellcheck disable=SC2086 -MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +MODIFIED_STARTUP=$(echo -e "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g') echo -e "${CYAN}STARTUP /home/container: ${MODIFIED_STARTUP} ${RESET_COLOR}" # Run the Server -# shellcheck disable=SC2086 -eval ${MODIFIED_STARTUP} +eval "${MODIFIED_STARTUP}"