Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Update Sogbot #2518

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bots/twitch/sogebot/egg-soge-bot.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2023-04-23T18:47:53+02:00",
"exported_at": "2023-10-21T10:23:47+02:00",
"name": "SogeBot",
"author": "[email protected]",
"description": "sogeBot - Free Twitch Bot built on Node.js https:\/\/sogebot.xyz\/",
"features": null,
"docker_images": {
"ghcr.io\/parkervcp\/yolks:nodejs_18": "ghcr.io\/parkervcp\/yolks:nodejs_18"
"Nodejs_18": "ghcr.io\/parkervcp\/yolks:nodejs_18"
},
"file_denylist": [],
"startup": "npm start",
Expand All @@ -22,7 +22,7 @@
},
"scripts": {
"installation": {
"script": "#\/bin\/bash\r\n# Installscript for sogeBot | Author: [email protected]\r\n\r\nexport DEBIAN_FRONTEND=noninteractive\r\n\r\napt -y update\r\napt install -y curl unzip jq python3 build-essential ca-certificates\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\nexport NODE_OPTIONS=--max-old-space-size=8192\r\nchown -R root:root \/mnt\r\n\r\n#Backup database & config\r\nmkdir -p .backup\r\ncp -f .env \/mnt\/server\/.backup\r\ncp -f sogebot.db \/mnt\/server\/.backup\r\n\r\n#delete old dir's to prevent errors on update\r\nrm -fR dest\r\nrm -fR public\r\nrm -fR node-modules\r\nrm -fR tools\r\n\r\n## get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/sogebot\/sogeBot\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/sogebot\/sogeBot\/releases\")\r\nMATCH=sogeBot\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\necho -e \"Downloading from $DOWNLOAD_LINK\"\r\ncurl -sSL -o sogeBot.zip ${DOWNLOAD_LINK}\r\n\r\nunzip -o sogeBot.zip\r\nrm -rf sogeBot.zip\r\n\r\n\r\necho \"--------------------------------------------------------------------------\"\r\necho \"Installing dependencies, this will take some time so sit back and relax...\"\r\necho \"IGNORE WARNINGS. THESE ARE NOT ERRORS !!!\"\r\necho \"--------------------------------------------------------------------------\"\r\n\r\nnpm install -g npm@8\r\n\r\nnpm install --verbose --force\r\n\r\necho -e \"install completed\"\r\nexit 0",
"script": "#\/bin\/bash\r\n# Installscript for sogeBot | Author: [email protected]\r\n\r\nexport DEBIAN_FRONTEND=noninteractive\r\n\r\napt -y update\r\napt install -y curl unzip jq python3 build-essential ca-certificates\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\n#Backup database & config\r\nif [ -f \"\/mnt\/server\/sogebot.db\" ]; then\r\n mkdir -p .backup\r\n cp -f .env \/mnt\/server\/.backup\r\n cp -f sogebot.db \/mnt\/server\/.backup\r\nfi\r\n\r\n#delete old dir's to prevent errors on update\r\nrm -fR dest\r\nrm -fR public\r\nrm -fR node-modules\r\nrm -fR tools\r\n\r\n## get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/sogebot\/sogeBot\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/sogebot\/sogeBot\/releases?per_page=50\")\r\nMATCH=\"sogebot-*.*.*.zip\"\r\n\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} | head -1)\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} | head -1)\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 | grep -i \"zip\" | head -1)\r\n fi\r\nfi\r\n\r\n# Download the files\r\necho \"Running: curl -sSL -o sogeBot.zip ${DOWNLOAD_URL}\"\r\ncurl -sSL -o sogeBot.zip ${DOWNLOAD_URL}\r\n\r\nunzip -o sogeBot.zip\r\nrm -rf sogeBot.zip\r\n\r\necho \"--------------------------------------------------------------------------\"\r\necho \"Installing dependencies, this will take some time so sit back and relax...\"\r\necho \"IGNORE WARNINGS. THESE ARE NOT ERRORS !!!\"\r\necho \"--------------------------------------------------------------------------\"\r\n\r\nnpm install --location=global npm@latest\r\nnpm install\r\n\r\necho \"--------------------------------------------------------------------------\"\r\necho \"install completed\"\r\necho \"--------------------------------------------------------------------------\"\r\nexit 0",
"container": "node:18-bullseye-slim",
"entrypoint": "bash"
}
Expand All @@ -39,4 +39,4 @@
"field_type": "text"
}
]
}
}