upgrades: add LFS assert

This commit is contained in:
Twenty Panda 2024-03-17 17:22:44 +01:00
parent 51f7263dee
commit 21920b10d9
4 changed files with 42 additions and 9 deletions

View file

@ -249,14 +249,20 @@ function reset_garage() {
rm -fr $DIR/garage
}
function forgejo_cli() {
local version="$1"
shift
local work_path=$DIR/forgejo-work-path
$DIR_BINARIES/forgejo-$version --config $work_path/app.ini --work-path $work_path "$@"
}
function create_user_and_login() {
local version=$1
local work_path=$DIR/forgejo-work-path
local email="$FORGEJO_USER@example.com"
local cli="$DIR_BINARIES/forgejo-$version --config $work_path/app.ini --work-path $work_path"
if ! $cli admin user list | grep --quiet "$email" ; then
$cli admin user create --admin --username "$FORGEJO_USER" --password "$FORGEJO_PASSWORD" --email $email
if ! forgejo_cli $version admin user list | grep --quiet "$email" ; then
forgejo_cli $version admin user create --admin --username "$FORGEJO_USER" --password "$FORGEJO_PASSWORD" --email $email
fi
forgejo-curl.sh logout