diff --git a/scripts/_common.sh b/scripts/_common.sh index 6a0fc98..5c4b0ab 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -#pkg_dependencies="golang-go" +pkg_dependencies="postgresql postgresql-contrib" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index f644405..435c233 100755 --- a/scripts/install +++ b/scripts/install @@ -71,7 +71,11 @@ ynh_app_setting_set --app=$app --key=tls_port --value=$tls_port #================================================= # INSTALL DEPENDENCIES #================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 +ynh_install_app_dependencies $pkg_dependencies + +# Install Go if needed if ! command -v /usr/local/go/bin/go &> /dev/null then ynh_script_progression --message="Installing Go dependency... (this will take some time)" --time --weight=3 diff --git a/scripts/remove b/scripts/remove index db682ee..4b25223 100755 --- a/scripts/remove +++ b/scripts/remove @@ -53,10 +53,10 @@ ynh_psql_remove_db --db_user=$app --db_name=$app #================================================= # REMOVE DEPENDENCIES #================================================= -#ynh_script_progression --message="Removing dependencies..." --time --weight=1 +ynh_script_progression --message="Removing dependencies..." --time --weight=1 # Remove metapackage and its dependencies -#ynh_remove_app_dependencies +ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR diff --git a/scripts/restore b/scripts/restore index 04baa3f..30cf7c5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -81,7 +81,12 @@ chown -R $app:root /var/log/$app #================================================= # REINSTALL DEPENDENCIES #================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + +# Install Go if needed if ! command -v /usr/local/go/bin/go &> /dev/null then ynh_script_progression --message="Installing Go dependency... (this will take some time)" --time --weight=3 diff --git a/scripts/upgrade b/scripts/upgrade index ed2c219..a3c585c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -85,6 +85,9 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_install_app_dependencies "$pkg_dependencies" # TODO: check Go version and upgrade if needed if ! command -v /usr/local/go/bin/go &> /dev/null