services/.helpers/download-gitea.sh
Dan Anglin f2a5829aed
fix: easily deploy specific versions of Gitea
Update templates and add a helper script to download and build the
version of Gitea that is specified in the configuration file.
2022-11-18 23:26:33 +00:00

16 lines
712 B
Bash

#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
export $(cat ./config/flow-platform.cfg | grep GITEA_VERSION | tr -d "\"")
if ! [ -f ./build/gitea/gitea-${GITEA_VERSION}-linux-amd64 ]; then
echo "Downloading Gitea ${GITEA_VERSION}..."
curl -sSL https://dl.gitea.io/gitea/${GITEA_VERSION}/gitea-${GITEA_VERSION}-linux-amd64 -o ./build/gitea/gitea-${GITEA_VERSION}-linux-amd64
curl -sSL https://dl.gitea.io/gitea/${GITEA_VERSION}/gitea-${GITEA_VERSION}-linux-amd64.sha256 -o ./build/gitea/gitea-${GITEA_VERSION}-linux-amd64.sha256
( cd ./build/gitea && sha256sum --check gitea-${GITEA_VERSION}-linux-amd64.sha256 )
else
echo "Gitea ${GITEA_VERSION} is already present."
fi