Update Waterfall

This commit is contained in:
Pishangfy 2020-08-04 09:35:50 +08:00 committed by GitHub
parent a2da99ba38
commit 7f386ea32f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@
},
"scripts": {
"installation": {
"script": "#!\/bin\/bash\r\n# Paper Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y curl jq\r\n\r\nmkdir -p \/mnt\/server\/\r\ncd \/mnt\/server\r\n\r\nif [ -n \"${DL_PATH}\" ]; then\r\n echo -e \"using supplied download url\"\r\n DOWNLOAD_URL=`eval echo $(echo ${DL_PATH} | sed -e 's\/{{\/${\/g' -e 's\/}}\/}\/g')`\r\nelse\r\n if [ -z \"$VANILLA_VERSION\" ] || [ \"${MINECRAFT_VERSION}\" == \"latest\" ]; then\r\n echo -e \"getting latest supported mc version and latest paper build\"\r\n MINECRAFT_VERSION=$(curl -s https:\/\/papermc.io\/api\/v1\/waterfall | jq -r '.versions[0]')\r\n BUILD_NUMBER=$(curl -sSL https:\/\/papermc.io\/api\/v1\/waterfall\/${MINECRAFT_VERSION} | jq -r '.builds.latest')\r\n VER_EXISTS=true\r\n else\r\n echo -e \"checking if version ${MINECRAFT_VERSION} exists\"\r\n VER_EXISTS=$(curl -s https:\/\/papermc.io\/api\/v1\/waterfall | jq -r --arg VERSION ${MINECRAFT_VERSION} '.versions[] | contains($VERSION)' | grep true)\r\n fi\r\n \r\n if [ \"${VER_EXISTS}\" == \"true\" ]; then\r\n echo -e \"Version is valid. Using version ${MINECRAFT_VERSION}\"\r\n else\r\n echo -e \"Using the latest waterfall version\"\r\n MINECRAFT_VERSION=${LATEST_WATERFALL_VERSION}\r\n fi\r\n \r\n BUILD_EXISTS=$(curl -sSL https:\/\/papermc.io\/api\/v1\/waterfall\/${MINECRAFT_VERSION} | jq -r --arg BUILD ${BUILD_NUMBER} '.builds.all[] | contains($BUILD)' | grep true)\r\n \r\n if [ \"${BUILD_EXISTS}\" == \"true\" ] || [ ${BUILD_NUMBER} == \"latest\" ]; then\r\n echo -e \"Build is valid. Using version ${BUILD_NUMBER}\"\r\n else\r\n echo -e \"Using the latest paper build for version ${MINECRAFT_VERSION}\"\r\n BUILD_NUMBER=$(curl -sSL https:\/\/papermc.io\/api\/v1\/waterfall\/${MINECRAFT_VERSION} | jq -r '.builds.latest')\r\n fi\r\n \r\n echo \"Version being downloaded\"\r\n echo -e \"MC Version: ${MINECRAFT_VERSION}\"\r\n echo -e \"Build: ${BUILD_NUMBER}\"\r\n DOWNLOAD_URL=https:\/\/papermc.io\/api\/v1\/waterfall\/${MINECRAFT_VERSION}\/${BUILD_NUMBER}\/download \r\nfi\r\n\r\nif [ -z ${SERVER_JARFILE} ]; then\r\n SERVER_JARFILE=server.jar\r\nfi\r\n\r\nif [[ ! $SERVER_JARFILE = *\\.jar ]]; then\r\n SERVER_JARFILE=\"$SERVER_JARFILE.jar\"\r\nfi\r\n\r\necho -e \"running curl -o ${SERVER_JARFILE} ${DOWNLOAD_URL}\"\r\n\r\ncurl -o ${SERVER_JARFILE} ${DOWNLOAD_URL}\r\n\r\nif [ ! -f config.yml ]; then\r\n echo -e \"Downloading waterfall config.yml\"\r\n curl -o config.yml https:\/\/raw.githubusercontent.com\/parkervcp\/eggs\/master\/minecraft_proxy\/waterfall\/config.yml\r\nelse\r\n echo -e \"Waterfall config.yml exists. Will not pull a new file\"\r\nfi",
"script": "#!\/bin\/bash\r\n# Paper Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y curl jq\r\n\r\nmkdir -p \/mnt\/server\/\r\ncd \/mnt\/server\r\n\r\nif [ -n \"${DL_PATH}\" ]; then\r\n echo -e \"using supplied download url\"\r\n DOWNLOAD_URL=`eval echo $(echo ${DL_PATH} | sed -e 's\/{{\/${\/g' -e 's\/}}\/}\/g')`\r\nelse\r\n if [ -z \"$VANILLA_VERSION\" ] || [ \"${MINECRAFT_VERSION}\" == \"latest\" ]; then\r\n echo -e \"getting latest supported mc version and latest paper build\"\r\n MINECRAFT_VERSION=$(curl -s https:\/\/papermc.io\/api\/v1\/waterfall | jq -r '.versions[0]')\r\n BUILD_NUMBER=$(curl -sSL https:\/\/papermc.io\/api\/v1\/waterfall\/${MINECRAFT_VERSION} | jq -r '.builds.latest')\r\n VER_EXISTS=true\r\n else\r\n echo -e \"checking if version ${MINECRAFT_VERSION} exists\"\r\n VER_EXISTS=$(curl -s https:\/\/papermc.io\/api\/v1\/waterfall | jq -r --arg VERSION ${MINECRAFT_VERSION} '.versions[] | contains($VERSION)' | grep true)\r\n fi\r\n \r\n if [ \"${VER_EXISTS}\" == \"true\" ]; then\r\n echo -e \"Version is valid. Using version ${MINECRAFT_VERSION}\"\r\n else\r\n echo -e \"Using the latest waterfall version\"\r\n MINECRAFT_VERSION=${LATEST_WATERFALL_VERSION}\r\n fi\r\n \r\n BUILD_EXISTS=$(curl -sSL https:\/\/papermc.io\/api\/v1\/waterfall\/${MINECRAFT_VERSION} | jq -r --arg BUILD ${BUILD_NUMBER} '.builds.all[] | contains($BUILD)' | grep true)\r\n \r\n if [ \"${BUILD_EXISTS}\" == \"true\" ] || [ ${BUILD_NUMBER} == \"latest\" ]; then\r\n echo -e \"Build is valid. Using version ${BUILD_NUMBER}\"\r\n else\r\n echo -e \"Using the latest paper build for version ${MINECRAFT_VERSION}\"\r\n BUILD_NUMBER=$(curl -sSL https:\/\/papermc.io\/api\/v1\/waterfall\/${MINECRAFT_VERSION} | jq -r '.builds.latest')\r\n fi\r\n \r\n echo \"Version being downloaded\"\r\n echo -e \"MC Version: ${MINECRAFT_VERSION}\"\r\n echo -e \"Build: ${BUILD_NUMBER}\"\r\n DOWNLOAD_URL=https:\/\/papermc.io\/api\/v1\/waterfall\/${MINECRAFT_VERSION}\/${BUILD_NUMBER}\/download \r\nfi\r\n\r\nif [ -z ${SERVER_JARFILE} ]; then\r\n SERVER_JARFILE=server.jar\r\nfi\r\n\r\nif [[ ! $SERVER_JARFILE = *\\.jar ]]; then\r\n SERVER_JARFILE=\"$SERVER_JARFILE.jar\"\r\nfi\r\n\r\necho -e \"running curl -o ${SERVER_JARFILE} ${DOWNLOAD_URL}\"\r\n\r\ncurl -o ${SERVER_JARFILE} ${DOWNLOAD_URL}\r\n\r\nif [ ! -f config.yml ]; then\r\n echo -e \"Downloading waterfall config.yml\"\r\n curl -o config.yml https:\/\/raw.githubusercontent.com\/parkervcp\/eggs\/master\/minecraft\/proxy\/waterfall\/config.yml\r\nelse\r\n echo -e \"Waterfall config.yml exists. Will not pull a new file\"\r\nfi",
"container": "debian:buster-slim",
"entrypoint": "bash"
}
@ -60,4 +60,4 @@
"rules": "required|string|max:20"
}
]
}
}