Improvement in the installation script

Fixes to avoid a silly mistake
This commit is contained in:
Ryan Pereira 2023-10-24 16:07:18 -03:00 committed by GitHub
parent 8df6baf928
commit fad1d2b915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@
"version": "PTDL_v2", "version": "PTDL_v2",
"update_url": null "update_url": null
}, },
"exported_at": "2023-10-12T13:05:55-03:00", "exported_at": "2023-10-24T15:54:39-03:00",
"name": "Crucible", "name": "Crucible",
"author": "ryanpereira.profissional@gmail.com", "author": "ryanpereira.profissional@gmail.com",
"description": "Crucible is a Thermos with several improvements. We aim to close the gaps left by Thermos and extend the support for those still on 1.7.10 by adding support for long broken mods and plugins and fix serious bugs as they appear.", "description": "Crucible is a Thermos with several improvements. We aim to close the gaps left by Thermos and extend the support for those still on 1.7.10 by adding support for long broken mods and plugins and fix serious bugs as they appear.",
@ -22,7 +22,7 @@
}, },
"scripts": { "scripts": {
"installation": { "installation": {
"script": "#!\/bin\/ash\r\n# Crucible Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\ncd \/mnt\/server\r\n#!\/bin\/bash\r\n# CRUCIBLE_VERSION=\"staging-81fcb90\"\r\n# SERVER_JARFILE=\"server.jar\"\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/CrucibleMC\/Crucible\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/CrucibleMC\/Crucible\/releases\")\r\nMATCH=\"Crucible-1\\.7\\.10-.*\\.jar\"\r\nDOWNLOAD_URL=\"\"\r\nDOWNLOAD_URL_LIB=\"\"\r\n\r\nif [ -z \"${GITHUB_USER}\" ] && [ -z \"${GITHUB_OAUTH_TOKEN}\" ] ; then\r\n echo -e \"using anon api call\"\r\nelse\r\n echo -e \"user and oauth token set\"\r\n alias curl='curl -u ${GITHUB_USER}:${GITHUB_OAUTH_TOKEN} '\r\nfi\r\n\r\nif [ -z \"${VERSION}\" ] || [ \"${VERSION}\" == \"latest\" ]; then\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})\r\nelse\r\n VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"${VERSION}\" == \"${VERSION_CHECK}\" ]; then\r\n DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})\r\n DOWNLOAD_URL_LIB=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i libraries.zip\r\n)\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\ncurl -sSL $DOWNLOAD_URL -o ${SERVER_JARFILE}\r\nwget $DOWNLOAD_URL_LIB -O temp.zip\r\nunzip temp.zip -d libraries\r\nrm temp.zip", "script": "#!\/bin\/ash\r\n# Crucible Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\ncd \/mnt\/server\r\n#!\/bin\/bash\r\n# CRUCIBLE_VERSION=\"staging-81fcb90\"\r\n# SERVER_JARFILE=\"server.jar\"\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/CrucibleMC\/Crucible\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/CrucibleMC\/Crucible\/releases\")\r\nMATCH=\"Crucible-1\\.7\\.10-.*\\.jar\"\r\nDOWNLOAD_URL=\"\"\r\nDOWNLOAD_URL_LIB=\"\"\r\n\r\nif [ -z \"${GITHUB_USER}\" ] && [ -z \"${GITHUB_OAUTH_TOKEN}\" ] ; then\r\n echo -e \"using anon api call\"\r\nelse\r\n echo -e \"user and oauth token set\"\r\n alias curl='curl -u ${GITHUB_USER}:${GITHUB_OAUTH_TOKEN} '\r\nfi\r\n\r\nif [ -z \"${VERSION}\" ] || [ \"${VERSION}\" == \"latest\" ]; then\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})\r\nelse\r\n VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"${VERSION}\" == \"${VERSION_CHECK}\" ]; then\r\n DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})\r\n DOWNLOAD_URL_LIB=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i libraries.zip\r\n)\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\ncurl -sSL $DOWNLOAD_URL -o ${SERVER_JARFILE}\r\nif [ -n \"${DOWNLOAD_URL_LIB}\" ]; then\r\n wget $DOWNLOAD_URL_LIB -O temp.zip\r\n unzip temp.zip -d libraries\r\n rm temp.zip\r\nfi",
"container": "ghcr.io\/pterodactyl\/installers:alpine", "container": "ghcr.io\/pterodactyl\/installers:alpine",
"entrypoint": "ash" "entrypoint": "ash"
} }