From 50a03353db2d8420978da902b5f0fc988ea9fe12 Mon Sep 17 00:00:00 2001 From: Eduard Veit Date: Tue, 15 Mar 2022 20:33:47 +0100 Subject: [PATCH] change gitea-update procedure - use SIGHUP to terminate as recommendet - flush-queues and stop the service before downloading to give it more time to terminate --- uberspace-gitea-installer.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/uberspace-gitea-installer.sh b/uberspace-gitea-installer.sh index 7f9e3e2..fec585d 100644 --- a/uberspace-gitea-installer.sh +++ b/uberspace-gitea-installer.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash APP_NAME=Gitea +DEFAULT_PORT=3000 GITEA_BIN_LOCATION=$HOME/gitea/gitea TMP_LOCATION=$HOME/tmp GPG_KEY_FINGERPRINT=7C9E68152594688862D62AF62D9AE806EC1592E2 @@ -44,7 +45,7 @@ function install_gitea --email "${USER}"@uber.space \ --admin \ --config "/home/${USER}/gitea/custom/conf/app.ini" - uberspace web backend set / --http --port 3000 + uberspace web backend set / --http --port $DEFAULT_PORT uberspace web backend list install_update_script printf "You can now access your $APP_NAME by directing you Browser to: \n https://%s.uber.space \n" "$USER" @@ -137,6 +138,7 @@ function create_gitea_daemon_config directory=%(ENV_HOME)s/gitea command=gitea web startsecs=30 +stopsignal=HUP autorestart=true end_of_content } @@ -194,15 +196,14 @@ GITHUB_API_URL=https://api.github.com/repos/$ORG/$REPO/releases/latest function do_update_procedure { + $GITEA_LOCATION manager flush-queues + supervisorctl stop gitea wget --quiet --progress=bar:force --output-document $TMP_LOCATION/gitea "$DOWNLOAD_URL" verify_file supervisorctl stop gitea mv --verbose $TMP_LOCATION/gitea "$GITEA_LOCATION" chmod u+x --verbose "$GITEA_LOCATION" - echo "Start gitea migration" - $GITEA_LOCATION migrate supervisorctl start gitea - sleep 5 supervisorctl status gitea }