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:
parent
67a2370ebf
commit
daec4e8e4b
3 changed files with 9 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue