services/.helpers/download-forgejo.sh

26 lines
1.1 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
export $(cat ./config/flow-platform-services.cfg | grep FORGEJO_VERSION | tr -d "\"")
declare -A CODEBERG_FORGEJO_BINARIES=(
[1.18.3-0]="https://codeberg.org/attachments/af34fbfc-d651-41b1-aaff-2b9cc7134051"
)
declare -A CODEBERG_FORGEJO_BINARY_SIGNATURES=(
[1.18.3-0]="https://codeberg.org/attachments/f064c1a9-66f7-41a9-be03-4dc5e2298370"
)
if ! [ -f ./build/forgejo/forgejo-${FORGEJO_VERSION}-linux-amd64 ]; then
echo "Downloading Forgejo ${FORGEJO_VERSION}..."
#curl -sSL https://github.com/go-gitea/gitea/releases/download/v${FORGEJO_VERSION}/gitea-${FORGEJO_VERSION}-linux-amd64 -o ./build/gitea/gitea-${FORGEJO_VERSION}-linux-amd64
curl -sSL ${CODEBERG_FORGEJO_BINARIES[${FORGEJO_VERSION}]} -o ./build/forgejo/forgejo-${FORGEJO_VERSION}-linux-amd64
curl -sSL ${CODEBERG_FORGEJO_BINARY_SIGNATURES[${FORGEJO_VERSION}]} -o ./build/forgejo/forgejo-${FORGEJO_VERSION}-linux-amd64.asc
( cd ./build/forgejo && gpg --verify forgejo-${FORGEJO_VERSION}-linux-amd64.asc forgejo-${FORGEJO_VERSION}-linux-amd64 )
else
echo "Forgejo ${FORGEJO_VERSION} is already present."
fi