From a08ffb9ed7cde650af53f93c15bd01c72a6e2630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 15 May 2023 15:04:02 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 712c5e4..dec3d96 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,21 +19,25 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" #================================================= -# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE +# BUILD APP #================================================= +ynh_script_progression --message="Building app..." --weight=1 if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." --weight=1 + ynh_exec_warn_less ynh_install_go --go_version=$go_version + ynh_use_go - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" + pushd $install_dir + git pull https://git.j3s.sh/vore "$install_dir" --quiet + ynh_add_config --template="../conf/index.tmpl.html" --destination="$install_dir/files/index.tmpl.html" + ynh_exec_warn_less ynh_exec_as $app CGO_ENABLED=0 $ynh_go build -o $install_dir/ + popd + + chown -R $app:www-data "$install_dir" + chmod +x "$install_dir/vore" fi -chown -R $app:www-data "$install_dir" - #================================================= # REAPPLY SYSTEM CONFIGURATIONS #=================================================