diff --git a/scripts/upgrade b/scripts/upgrade index 26043ba..a811169 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -2,12 +2,16 @@ set -euo pipefail source ./_common.sh -systemctl stop "$app" 2>/dev/null || true +app="${YNH_APP_INSTANCE_NAME:-albumik}" + mkdir -p "$install_dir" -rm -rf "$install_dir/backend" "$install_dir/web" "$install_dir/doc" -cp -a backend web doc "$install_dir"/ + +cp -a "$YNH_APP_BASEDIR/backend" "$YNH_APP_BASEDIR/web" "$YNH_APP_BASEDIR/doc" "$install_dir"/ + chown -R "$app:$app" "$install_dir" + systemctl daemon-reload -systemctl start "$app" -systemctl reload nginx || true -echo "Albumik upgraded" +systemctl restart "$app" + +nginx -t +systemctl reload nginx