1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nomad_ynh.git synced 2024-09-03 19:55:53 +02:00

Fix usage of go

This commit is contained in:
Félix Piédallu 2024-03-20 13:39:38 +01:00 committed by Félix Piédallu
parent 67a2370ebf
commit daec4e8e4b
3 changed files with 9 additions and 9 deletions

View file

@ -31,13 +31,13 @@ chown -R "$app:$app" "$data_dir"
# BUILD DRIVERS # BUILD DRIVERS
#================================================= #=================================================
if [ "$node_type" == "client" ] && [ "$driver_lxc" -eq 1 ]; then 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_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" ynh_setup_source --dest_dir="$install_dir/driver_lxc" --source_id="driver_lxc"
pushd "$install_dir/driver_lxc" pushd "$install_dir/driver_lxc"
ynh_use_go
export GOPATH="$install_dir/driver_lxc/go" export GOPATH="$install_dir/driver_lxc/go"
export GOCACHE="$install_dir/driver_lxc/.cache" export GOCACHE="$install_dir/driver_lxc/.cache"
ynh_exec_warn_less "$ynh_go" build ynh_exec_warn_less "$ynh_go" build

View file

@ -24,13 +24,13 @@ ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$a
# BUILD DRIVERS # BUILD DRIVERS
#================================================= #=================================================
if [ "$node_type" == "client" ] && [ "$driver_lxc" -eq 1 ]; then 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_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" ynh_setup_source --dest_dir="$install_dir/driver_lxc" --source_id="driver_lxc"
pushd "$install_dir/driver_lxc" pushd "$install_dir/driver_lxc"
ynh_use_go
export GOPATH="$install_dir/driver_lxc/go" export GOPATH="$install_dir/driver_lxc/go"
export GOCACHE="$install_dir/driver_lxc/.cache" export GOCACHE="$install_dir/driver_lxc/.cache"
ynh_exec_warn_less "$ynh_go" build ynh_exec_warn_less "$ynh_go" build

View file

@ -30,7 +30,7 @@ export GOENV_ROOT="$goenv_install_dir"
# However, $PATH is duplicated into $go_path to outlast any manipulation of $PATH # 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 # You can use the variable `$ynh_go_load_path` to quickly load your Go version
# in $PATH for an usage into a separate script. # 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 # 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" ynh_go_load_path="PATH=$PATH"
# Sets the local application-specific Go version # Sets the local application-specific Go version
pushd $final_path pushd $install_dir
$goenv_install_dir/bin/goenv local $go_version $goenv_install_dir/bin/goenv local $go_version
popd popd
} }