minor: small refactorings

This commit is contained in:
EV21 committed 2022-07-31 10:11:09 +02:00
1 parent 2404c956d1
commit d041330627
2 files changed
+13 -18

No files matched your search

+13 -17
View File
@@ -87,23 +87,23 @@ GITEA_BIN_LOCATION=$HOME/gitea/gitea
case $FIRST_PARAMETER in case $FIRST_PARAMETER in
start | stop | restart | status ) start | stop | restart | status )
supervisorctl $FIRST_PARAMETER gitea supervisorctl $FIRST_PARAMETER gitea
exit $? exit $?
;; ;;
update | upgrade ) update | upgrade )
gitea-update gitea-update
exit $? exit $?
;; ;;
log | logs ) log | logs )
less ~/logs/supervisord.log less ~/logs/supervisord.log
exit $? exit $?
;; ;;
backup ) backup )
## this command creates a backup zip file with db, repos, config, log, data ## this command creates a backup zip file with db, repos, config, log, data
## restoring the backup is more difficult ## restoring the backup is more difficult
## read: https://docs.gitea.io/en-us/backup-and-restore/#restore-command-restore ## read: https://docs.gitea.io/en-us/backup-and-restore/#restore-command-restore
$GITEA_BIN_LOCATION dump --tempdir $HOME/tmp $GITEA_BIN_LOCATION dump --tempdir $HOME/tmp
exit $? exit $?
;; ;;
esac esac
@@ -147,9 +147,6 @@ NO_REPLY_ADDRESS = noreply.${USER}.uber.space
ENABLED = true ENABLED = true
MAILER_TYPE = sendmail MAILER_TYPE = sendmail
FROM = ${USER}@uber.space FROM = ${USER}@uber.space
[repository]
DEFAULT_BRANCH = main
end_of_content end_of_content
} }
@@ -165,9 +162,9 @@ autorestart=true
end_of_content end_of_content
} }
function get_latest_version function get_download_url
{ {
curl --silent $GITHUB_API_URL > "$TMP_LOCATION"/github_api_response.json curl --silent "$GITHUB_API_URL" > "$TMP_LOCATION"/github_api_response.json
TAG_NAME=$(jq --raw-output '.tag_name' "$TMP_LOCATION"/github_api_response.json) TAG_NAME=$(jq --raw-output '.tag_name' "$TMP_LOCATION"/github_api_response.json)
LATEST_VERSION=${TAG_NAME:1} LATEST_VERSION=${TAG_NAME:1}
DOWNLOAD_URL=$(jq --raw-output '.assets[].browser_download_url' "$TMP_LOCATION"/github_api_response.json | DOWNLOAD_URL=$(jq --raw-output '.assets[].browser_download_url' "$TMP_LOCATION"/github_api_response.json |
@@ -224,7 +221,6 @@ function do_update_procedure
supervisorctl stop gitea supervisorctl stop gitea
wget --quiet --progress=bar:force --output-document $TMP_LOCATION/gitea "$DOWNLOAD_URL" wget --quiet --progress=bar:force --output-document $TMP_LOCATION/gitea "$DOWNLOAD_URL"
verify_file verify_file
supervisorctl stop gitea
mv --verbose $TMP_LOCATION/gitea "$GITEA_LOCATION" mv --verbose $TMP_LOCATION/gitea "$GITEA_LOCATION"
chmod u+x --verbose "$GITEA_LOCATION" chmod u+x --verbose "$GITEA_LOCATION"
supervisorctl start gitea supervisorctl start gitea
-1
View File
@@ -15,7 +15,6 @@ function do_update_procedure
supervisorctl stop gitea supervisorctl stop gitea
wget --quiet --progress=bar:force --output-document "$TMP_LOCATION"/gitea "$DOWNLOAD_URL" wget --quiet --progress=bar:force --output-document "$TMP_LOCATION"/gitea "$DOWNLOAD_URL"
verify_file verify_file
supervisorctl stop gitea
mv --verbose "$TMP_LOCATION"/gitea "$GITEA_LOCATION" mv --verbose "$TMP_LOCATION"/gitea "$GITEA_LOCATION"
chmod u+x --verbose "$GITEA_LOCATION" chmod u+x --verbose "$GITEA_LOCATION"
supervisorctl start gitea supervisorctl start gitea