mirror of
https://github.com/parkervcp/eggs.git
synced 2025-01-09 22:22:56 +08:00
Fix that Release is not downloaded and fix new Reproname
This commit is contained in:
parent
f104b9fd33
commit
8d4e6acfca
@ -3,7 +3,7 @@
|
||||
"meta": {
|
||||
"version": "PTDL_v1"
|
||||
},
|
||||
"exported_at": "2020-10-11T07:18:29+02:00",
|
||||
"exported_at": "2020-10-22T16:03:37+02:00",
|
||||
"name": "Among Us - Impostor Server",
|
||||
"author": "info@goover.de",
|
||||
"description": "Impostor is one of the first Among Us private servers, written in C#.\r\n\r\nThe latest version supported is 2020.9.22, both desktop and mobile.\r\n\r\nThere are no special features at this moment, the goal is aiming to be as close as possible to the real server, for now. In a later stage, making modifications to game logic by modifying GameData packets can be looked at.",
|
||||
@ -17,7 +17,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"installation": {
|
||||
"script": "#!\/bin\/bash\r\n\r\napt -y update\r\napt -y upgrade\r\napt -y --no-install-recommends install wget curl jq unzip tar redis-server file ca-certificates apt-utils\r\n\r\nexport HOME=\/mnt\/server\r\ncd $HOME\r\n\r\n## this is a simple script to use the github API for release versions.\r\n## this requires the egg has a variable for GITHUB_PACKAGE, VERSION and MATCH (match is to match the filename in some way)\r\n## this supports using oauth\/personal access tokens via GITHUB_USER and GITHUB_OAUTH_TOKEN (both are required.)\r\n## if you are getting hit with GitHub API limit issues then you need to have the user and token set.\r\n\r\nif [ -z \"${GITHUB_USER}\" ] && [ -z \"${GITHUB_OAUTH_TOKEN}\" ] ; then\r\n echo -e \"[INFO] using anononym API Call\"\r\nelse\r\n echo -e \"[INFO] User and OAuth Token set\"\r\n alias curl='curl -u ${GITHUB_USER}:${GITHUB_OAUTH_TOKEN} '\r\nfi\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\nif [ ! -z \"${DOWNLOAD_URL}\"]; then \r\n if curl --output \/dev\/null --silent --head --fail ${DOWNLOAD_URL}; then\r\n echo -e \"link is valid. setting download link to ${DOWNLOAD_URL}\"\r\n DOWNLOAD_LINK=${DOWNLOAD_URL}\r\n else \r\n echo -e \"link is invalid closing out\"\r\n exit 2\r\n fi\r\nfi\r\necho $DOWNLOAD_LINK\r\nwget $DOWNLOAD_LINK\r\nunzip Impostor-Server-linux-x64.zip\r\nrm -fR Impostor-Server-linux-x64.zip \r\nchmod +x Impostor.Server",
|
||||
"script": "#!\/bin\/bash\r\n\r\napt -y update\r\napt -y upgrade\r\napt -y --no-install-recommends install wget curl jq unzip tar redis-server file ca-certificates apt-utils\r\n\r\nexport HOME=\/mnt\/server\r\ncd $HOME\r\n\r\n## Download latest Version or Tag\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\n## get release info and download links\r\n\r\nLATEST_RELEASE=$(curl -L -s -H 'Accept: application\/json' https:\/\/github.com\/${GITHUB_PACKAGE}\/releases\/latest)\r\nLATEST_VERSION=$(echo $LATEST_RELEASE | sed -e 's\/.*\"tag_name\":\"\\([^\"]*\\)\".*\/\\1\/')\r\nDOWNLOAD_LINK=\"https:\/\/github.com\/${GITHUB_PACKAGE}\/releases\/download\/$LATEST_VERSION\/$MATCH\"\r\n\r\necho $DOWNLOAD_LINK\r\nwget $DOWNLOAD_LINK\r\n\r\nunzip -o Impostor-Server-linux-x64.zip\r\nrm -fR Impostor-Server-linux-x64.zip \r\nchmod +x Impostor.Server",
|
||||
"container": "debian:buster-slim",
|
||||
"entrypoint": "bash"
|
||||
}
|
||||
@ -27,19 +27,10 @@
|
||||
"name": "GITHUB_PACKAGE",
|
||||
"description": "GITHUB_PACKAGE",
|
||||
"env_variable": "GITHUB_PACKAGE",
|
||||
"default_value": "AeonLucid\/Impostor",
|
||||
"default_value": "Impostor\/Impostor",
|
||||
"user_viewable": false,
|
||||
"user_editable": false,
|
||||
"rules": "required|string|max:20"
|
||||
},
|
||||
{
|
||||
"name": "VERSION",
|
||||
"description": "VERSION",
|
||||
"env_variable": "VERSION",
|
||||
"default_value": "latest",
|
||||
"user_viewable": false,
|
||||
"user_editable": false,
|
||||
"rules": "required|string|max:20"
|
||||
"rules": "required"
|
||||
},
|
||||
{
|
||||
"name": "MATCH",
|
||||
@ -48,7 +39,7 @@
|
||||
"default_value": "Impostor-Server-linux-x64.zip",
|
||||
"user_viewable": false,
|
||||
"user_editable": false,
|
||||
"rules": "required|string|max:40"
|
||||
"rules": "required"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user