mirror of
https://github.com/YunoHost-Apps/gogs_ynh.git
synced 2024-09-03 20:36:23 +02:00
handle upgrade from old package installation
This commit is contained in:
parent
1dc4613d8d
commit
cfe643d9ac
1 changed files with 17 additions and 2 deletions
|
@ -24,11 +24,26 @@ is_public=$(ynh_app_setting_get "$app" is_public)
|
||||||
# Stop service
|
# Stop service
|
||||||
sudo systemctl stop gogs.service
|
sudo systemctl stop gogs.service
|
||||||
|
|
||||||
|
# set directories variables
|
||||||
DESTDIR="/opt/$app"
|
DESTDIR="/opt/$app"
|
||||||
|
|
||||||
# create needed directories
|
|
||||||
REPO_PATH=/home/gogs/repositories
|
REPO_PATH=/home/gogs/repositories
|
||||||
DATA_PATH=/home/gogs/data
|
DATA_PATH=/home/gogs/data
|
||||||
|
|
||||||
|
# handle upgrade from old package installation
|
||||||
|
# this test that /etc/gogs exist since this was used in the old package
|
||||||
|
# but not in the new
|
||||||
|
# this code will be removed in the future
|
||||||
|
if [ -d "/etc/gogs" ]
|
||||||
|
then
|
||||||
|
# move re
|
||||||
|
old_repo_path=$(ynh_app_setting_get "$app" repopath)
|
||||||
|
sudo mv "$old_repo_path"/* "$REPO_PATH"
|
||||||
|
sudo unlink /opt/gogs
|
||||||
|
sudo rm -rf /etc/gogs /opt/gogs_src
|
||||||
|
fi
|
||||||
|
# end of old package upgrade
|
||||||
|
|
||||||
|
# create needed directories and give correct acl
|
||||||
sudo mkdir -p "$DESTDIR"/custom/conf "$REPO_PATH" "$DATA_PATH"/avatars \
|
sudo mkdir -p "$DESTDIR"/custom/conf "$REPO_PATH" "$DATA_PATH"/avatars \
|
||||||
"$DATA_PATH"/avatars "$DATA_PATH"/attachments /var/log/gogs
|
"$DATA_PATH"/avatars "$DATA_PATH"/attachments /var/log/gogs
|
||||||
sudo chown -R gogs:gogs /home/gogs /var/log/gogs
|
sudo chown -R gogs:gogs /home/gogs /var/log/gogs
|
||||||
|
|
Loading…
Add table
Reference in a new issue