Updated Egg to use Parkers GH Release Script

This commit is contained in:
Torsten Widmann 2020-09-06 10:52:41 +02:00
parent 6d3294f626
commit dc324a7e8a

View File

@ -3,7 +3,7 @@
"meta": {
"version": "PTDL_v1"
},
"exported_at": "2020-09-03T12:17:04+02:00",
"exported_at": "2020-09-06T10:51:50+02:00",
"name": "SogeBot",
"author": "info@goover.de",
"description": "sogeBot - Free Twitch Bot built on Node.js https:\/\/sogebot.xyz\/",
@ -17,10 +17,38 @@
},
"scripts": {
"installation": {
"script": "#\/bin\/bash\r\napt -y update\r\napt -y upgrade\r\napt install -y curl unzip sqlite\r\n#export NODE_OPTIONS=--max-old-space-size=8192\r\n\r\ncd \/mnt\/server\r\n\r\n## Download latest Stable Version\r\nRELEASE_VERSION=$(curl -s \"https:\/\/api.github.com\/repos\/sogehige\/sogeBot\/releases\/latest\" | awk -F '\"' '\/tag_name\/{print $4}')\r\nDOWNLOAD_URL=https:\/\/github.com\/sogehige\/sogeBot\/releases\/download\/${RELEASE_VERSION}\/sogeBot-${RELEASE_VERSION}.zip\r\ncurl -L -o sogebot.zip ${DOWNLOAD_URL}\r\nunzip -o sogebot.zip\r\nrm sogebot.zip\r\n\r\nnpm install -g npm@latest\r\n\/usr\/local\/bin\/npm ci\r\n\r\nexit 0",
"script": "#\/bin\/bash\r\napt -y update\r\napt -y upgrade\r\napt install -y curl unzip sqlite jq wget\r\n#export NODE_OPTIONS=--max-old-space-size=8192\r\n\r\ncd \/mnt\/server\r\n\r\n## get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/${GITHUB_PACKAGE}\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/${GITHUB_PACKAGE}\/releases\")\r\n\r\nif [ -z \"${VERSION}\" ] || [ \"${VERSION}\" == \"latest\" ]; then\r\n DOWNLOAD_LINK=$(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_LINK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_LINK=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\n#echo $DOWNLOAD_LINK\r\nwget -N $DOWNLOAD_LINK\r\nunzip $MATCH-*.zip\r\nrm -fR unzip $MATCH-*.zip\r\n\r\nnpm install -g npm@latest\r\n\/usr\/local\/bin\/npm ci\r\n\r\nexit 0",
"container": "node:12-buster-slim",
"entrypoint": "bash"
}
},
"variables": []
"variables": [
{
"name": "Github Package",
"description": "the Github Package",
"env_variable": "GITHUB_PACKAGE",
"default_value": "sogehige\/sogeBot",
"user_viewable": true,
"user_editable": false,
"rules": "required|string|max:20"
},
{
"name": "Version",
"description": "choose Version, you want to install. Defaul: Latest",
"env_variable": "VERSION",
"default_value": "latest",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|max:20"
},
{
"name": "Filename",
"description": "Filename",
"env_variable": "MATCH",
"default_value": "sogeBot",
"user_viewable": true,
"user_editable": false,
"rules": "required|string|max:20"
}
]
}