feat: ${FORGEJO_INSTANCE:=https://codeberg.org} (#542)
Do not hardcode https://codeberg.org, use the FORGEJO_INSTANCE variable instead. It can be overriden when codeberg.org is unavailable. Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/542 Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org> Co-authored-by: limiting-factor <limiting-factor@posteo.com> Co-committed-by: limiting-factor <limiting-factor@posteo.com>
This commit is contained in:
parent
25b2635022
commit
6f6466b3f6
1 changed files with 3 additions and 2 deletions
|
|
@ -35,6 +35,7 @@ export DOT_FORGEJO_CURL=$DIR/forgejo-curl
|
|||
export DOT=$DOT_FORGEJO_CURL # for backward compatibility with forgejo-curl.sh 1.0.0
|
||||
: ${FORGEJO_USER:=root}
|
||||
: ${FORGEJO_PASSWORD:=admin1234}
|
||||
: ${FORGEJO_INSTANCE:=https://codeberg.org}
|
||||
ORGANIZATIONS=$(cat $LIB_DIR/ORGANIZATIONS)
|
||||
|
||||
function log_info() {
|
||||
|
|
@ -93,7 +94,7 @@ function full_version() {
|
|||
local owner=$2
|
||||
|
||||
if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then
|
||||
full_version=$(curl -sS "https://codeberg.org/api/v1/repos/$owner/forgejo/releases?limit=50" | jq -r '.[] | .tag_name | select(startswith("v'$version'"))' | sort --reverse --version-sort | head -1)
|
||||
full_version=$(curl -sS "$FORGEJO_INSTANCE/api/v1/repos/$owner/forgejo/releases?limit=50" | jq -r '.[] | .tag_name | select(startswith("v'$version'"))' | sort --reverse --version-sort | head -1)
|
||||
echo ${full_version#v}
|
||||
else
|
||||
echo $version
|
||||
|
|
@ -110,7 +111,7 @@ function download_forgejo() {
|
|||
if test "$full_version" = ""; then
|
||||
continue
|
||||
fi
|
||||
if wget -O $DIR_BINARIES/forgejo-$version --quiet https://codeberg.org/$owner/forgejo/releases/download/v$full_version/forgejo-$full_version-linux-amd64; then
|
||||
if wget -O $DIR_BINARIES/forgejo-$version --quiet $FORGEJO_INSTANCE/$owner/forgejo/releases/download/v$full_version/forgejo-$full_version-linux-amd64; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue