lib: move forgejocli to the forgejo instance WORK_PATH
Instead of having it in $DIR so that there can be one forgejocli per forgejo instance.
This commit is contained in:
parent
2461666aca
commit
b62866f3ae
3 changed files with 22 additions and 16 deletions
14
lib/lib.sh
14
lib/lib.sh
|
@ -181,9 +181,10 @@ function start_forgejo_daemon() {
|
|||
grep '' $work_path/log/*.log 2> /dev/null
|
||||
return 1
|
||||
fi
|
||||
echo "$binary --config $work_path/app.ini --work-path $work_path" '"$@"' > $DIR/forgejocli
|
||||
chmod +x $DIR/forgejocli
|
||||
create_user_and_login $version
|
||||
echo "$binary --config $work_path/app.ini --work-path $work_path" '"$@"' > $work_path/forgejocli
|
||||
chmod +x $work_path/forgejocli
|
||||
cp -a $work_path/forgejocli $DIR/forgejocli # because setup-forgejo/forgejo-runner.sh expects it here
|
||||
create_user_and_login $version $config
|
||||
}
|
||||
|
||||
function start_minio() {
|
||||
|
@ -287,10 +288,13 @@ function reset_garage() {
|
|||
|
||||
function create_user_and_login() {
|
||||
local version=$1
|
||||
local config=$2
|
||||
|
||||
local work_path=$DIR/$(work_path_base $config)
|
||||
|
||||
local email="$FORGEJO_USER@example.com"
|
||||
if ! $DIR/forgejocli admin user list | grep --quiet "$email" ; then
|
||||
$DIR/forgejocli admin user create --admin --username "$FORGEJO_USER" --password "$FORGEJO_PASSWORD" --email $email
|
||||
if ! $work_path/forgejocli admin user list | grep --quiet "$email" ; then
|
||||
$work_path/forgejocli admin user create --admin --username "$FORGEJO_USER" --password "$FORGEJO_PASSWORD" --email $email
|
||||
fi
|
||||
|
||||
forgejo-curl.sh logout
|
||||
|
|
Loading…
Add table
Reference in a new issue