forgejo-runner needs an IP, not localhost for the artifacts server

This commit is contained in:
Earl Warren 2023-12-20 22:22:58 +01:00
parent 418489ad4f
commit b51343081a
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 7 additions and 2 deletions

View file

@ -3,6 +3,7 @@ WORK_PATH = ${WORK_PATH}
[server] [server]
APP_DATA_PATH = ${WORK_PATH}/data APP_DATA_PATH = ${WORK_PATH}/data
DOMAIN = ${IP}
HTTP_PORT = 3000 HTTP_PORT = 3000
LFS_START_SERVER = true LFS_START_SERVER = true

View file

@ -78,6 +78,10 @@ function create_user() {
forgejo-curl.sh api_json $url/api/forgejo/v1/version forgejo-curl.sh api_json $url/api/forgejo/v1/version
} }
function myip() {
hostname -I | cut -f1 -d' '
}
function start_forgejo() { function start_forgejo() {
local work_path=$DIR/forgejo-work-path local work_path=$DIR/forgejo-work-path
daemon --chdir=$DIR --unsafe --env="TERM=$TERM" --env="HOME=$HOME" --env="PATH=$PATH" --pidfile=$DIR/forgejo-pid --errlog=$DIR/forgejo-err.log --output=$DIR/forgejo-out.log -- $DIR/forgejo --config $work_path/app.ini --work-path $work_path daemon --chdir=$DIR --unsafe --env="TERM=$TERM" --env="HOME=$HOME" --env="PATH=$PATH" --pidfile=$DIR/forgejo-pid --errlog=$DIR/forgejo-err.log --output=$DIR/forgejo-out.log -- $DIR/forgejo --config $work_path/app.ini --work-path $work_path
@ -88,7 +92,7 @@ function start_forgejo() {
fi fi
echo "$DIR/forgejo --config $work_path/app.ini --work-path $work_path" '"$@"' > $DIR/forgejocli echo "$DIR/forgejo --config $work_path/app.ini --work-path $work_path" '"$@"' > $DIR/forgejocli
chmod +x $DIR/forgejocli chmod +x $DIR/forgejocli
hostname -I | cut -f1 -d' ' > $DIR/forgejo-ip myip > $DIR/forgejo-ip
} }
function reset_forgejo() { function reset_forgejo() {
@ -96,7 +100,7 @@ function reset_forgejo() {
local work_path=$DIR/forgejo-work-path local work_path=$DIR/forgejo-work-path
rm -fr $work_path rm -fr $work_path
mkdir -p $work_path mkdir -p $work_path
WORK_PATH=$work_path envsubst < $SELF_DIR/$config-app.ini > $work_path/app.ini IP=$(myip) WORK_PATH=$work_path envsubst < $SELF_DIR/$config-app.ini > $work_path/app.ini
} }
function teardown() { function teardown() {