2023-02-20 09:37:08 +01:00
|
|
|
#!/usr/bin/env bash
|
2023-04-19 10:33:29 +02:00
|
|
|
VERSION=1.19.1-0
|
2023-02-20 09:37:08 +01:00
|
|
|
PLATFORM=linux-amd64
|
|
|
|
|
|
|
|
# If the signature is already downloaded, don't redownload it
|
2023-05-18 11:25:47 +02:00
|
|
|
if [ -f "forgejo-$VERSION-$PLATFORM.asc" ]; then
|
2023-02-20 09:37:08 +01:00
|
|
|
printf "Forĝejo signature already downloaded.\n"
|
|
|
|
else
|
2024-04-24 17:44:57 +02:00
|
|
|
printf "Downloading Forĝejo %b-%b signature…\n" "$VERSION" "$PLATFORM"
|
2023-02-20 09:37:08 +01:00
|
|
|
curl -LO "https://codeberg.org/forgejo/forgejo/releases/download/v$VERSION/forgejo-$VERSION-$PLATFORM.asc"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# If the binary is already downloaded, don't redownload it
|
2023-05-18 11:25:47 +02:00
|
|
|
if [ -f "forgejo-$VERSION-$PLATFORM" ]; then
|
2023-02-20 09:37:08 +01:00
|
|
|
printf "Forĝejo already downloaded.\n"
|
|
|
|
else
|
2024-04-24 17:44:57 +02:00
|
|
|
printf "Downloading Forĝejo %b on %b\n" "$VERSION" "$PLATFORM"
|
2023-02-20 09:37:08 +01:00
|
|
|
curl -LO "https://codeberg.org/forgejo/forgejo/releases/download/v$VERSION/forgejo-$VERSION-$PLATFORM"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# The last easy to automate part.
|
|
|
|
printf "Verifying signature…\n"
|
|
|
|
gpg --verify forgejo-$VERSION-$PLATFORM.asc
|
|
|
|
|
2023-02-20 10:14:56 +01:00
|
|
|
printf "Final steps: \n\t 1. Place the binary where the systemd service expects it.\n\t \
|
2024-04-24 17:44:57 +02:00
|
|
|
2. sudo chmod a+rx forgejo-%b-%b\n\t \
|
|
|
|
3. sudo ln -sf forgejo-%b-%b gitea \n\t \
|
|
|
|
4. sudo systemctl restart gitea" "$VERSION" "$PLATFORM" "$VERSION" "$PLATFORM"
|
2023-02-20 10:14:56 +01:00
|
|
|
echo
|