Last active
November 28, 2023 13:21
-
-
Save augustin64/8a7ed36a85a4b1da17802234cf1ee74b to your computer and use it in GitHub Desktop.
Update gitea to latest available version (from GH)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $USER != "root" ]]; then | |
echo "Run as root !" | |
exit 1 | |
fi; | |
# Config (you can hardcode values too) | |
TAG=$1 | |
[[ $TAG ]] || TAG=$(curl -Ss https://api.github.com/repos/go-gitea/gitea/releases | jq '.[0].tag_name' -r | awk '{print substr($1,2); }') | |
ARCH="linux-amd64" | |
OUTPUT_FILE=$(mktemp) | |
echo "Latest version: v$TAG" | |
echo "Target: $ARCH" | |
wget -q "https://github.com/go-gitea/gitea/releases/download/v${TAG}/gitea-${TAG}-${ARCH}" -O "$OUTPUT_FILE" | |
echo "File downloaded" | |
chmod +x "$OUTPUT_FILE" | |
mv "$OUTPUT_FILE" /usr/local/bin/gitea | |
systemctl restart gitea.service | |
echo "Gitea restarted" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment