From daec4e8e4b50b54746c9b0c0031456fd29468547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 13:39:38 +0100 Subject: [PATCH] Fix usage of go --- scripts/install | 6 +++--- scripts/upgrade | 6 +++--- scripts/ynh_install_go | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/install b/scripts/install index 7b64c21..ef99623 100644 --- a/scripts/install +++ b/scripts/install @@ -31,13 +31,13 @@ chown -R "$app:$app" "$data_dir" # BUILD DRIVERS #================================================= if [ "$node_type" == "client" ] && [ "$driver_lxc" -eq 1 ]; then - ynh_script_progression --message="Building LXC driver..." - + ynh_script_progression --message="Installing Go..." ynh_exec_warn_less ynh_install_go --go_version="$go_version" + ynh_use_go + ynh_script_progression --message="Building LXC driver..." ynh_setup_source --dest_dir="$install_dir/driver_lxc" --source_id="driver_lxc" pushd "$install_dir/driver_lxc" - ynh_use_go export GOPATH="$install_dir/driver_lxc/go" export GOCACHE="$install_dir/driver_lxc/.cache" ynh_exec_warn_less "$ynh_go" build diff --git a/scripts/upgrade b/scripts/upgrade index e976843..b3a12ab 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,13 +24,13 @@ ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$a # BUILD DRIVERS #================================================= if [ "$node_type" == "client" ] && [ "$driver_lxc" -eq 1 ]; then - ynh_script_progression --message="Building LXC driver..." - + ynh_script_progression --message="Installing Go..." ynh_exec_warn_less ynh_install_go --go_version="$go_version" + ynh_use_go + ynh_script_progression --message="Building LXC driver..." ynh_setup_source --dest_dir="$install_dir/driver_lxc" --source_id="driver_lxc" pushd "$install_dir/driver_lxc" - ynh_use_go export GOPATH="$install_dir/driver_lxc/go" export GOCACHE="$install_dir/driver_lxc/.cache" ynh_exec_warn_less "$ynh_go" build diff --git a/scripts/ynh_install_go b/scripts/ynh_install_go index e3ad06a..07695dd 100644 --- a/scripts/ynh_install_go +++ b/scripts/ynh_install_go @@ -30,7 +30,7 @@ export GOENV_ROOT="$goenv_install_dir" # However, $PATH is duplicated into $go_path to outlast any manipulation of $PATH # You can use the variable `$ynh_go_load_path` to quickly load your Go version # in $PATH for an usage into a separate script. -# Exemple: $ynh_go_load_path $final_path/script_that_use_gem.sh` +# Exemple: $ynh_go_load_path $install_dir/script_that_use_gem.sh` # # # Finally, to start a Go service with the correct version, 2 solutions @@ -72,7 +72,7 @@ ynh_use_go () { ynh_go_load_path="PATH=$PATH" # Sets the local application-specific Go version - pushd $final_path + pushd $install_dir $goenv_install_dir/bin/goenv local $go_version popd } @@ -224,7 +224,7 @@ ynh_cleanup_go () { required_go_versions="${installed_app_go_version}\n${required_go_versions}" fi done - + # Remove no more needed Go versions local installed_go_versions=$(goenv versions --bare --skip-aliases | grep -Ev '/') for installed_go_version in $installed_go_versions