From 4fd1c7846ce4b819f57af31a8d08912915327af0 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Wed, 22 Jul 2020 21:51:27 +0200 Subject: [PATCH] use local phantomjs installation --- scripts/_common.sh | 2 +- scripts/install | 9 +++++++++ scripts/remove | 8 ++++++++ scripts/restore | 8 ++++++++ scripts/upgrade | 7 +++++++ sources/extra_files/app/.env | 2 +- 6 files changed, 34 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index ecd263f..7a08e73 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="" +pkg_dependencies="phantomjs" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index d3df91d..b3627ec 100755 --- a/scripts/install +++ b/scripts/install @@ -72,6 +72,15 @@ db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name + +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." + +ynh_install_app_dependencies $pkg_dependencies + + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= diff --git a/scripts/remove b/scripts/remove index adfc93a..b82d4b9 100755 --- a/scripts/remove +++ b/scripts/remove @@ -32,6 +32,14 @@ ynh_script_progression --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/restore b/scripts/restore index 9005ecc..124a46e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -94,6 +94,14 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE CRON FILE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 46ac006..6559530 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,6 +89,13 @@ then ynh_setup_source --dest_dir="$final_path" fi +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # NGINX CONFIGURATION #================================================= diff --git a/sources/extra_files/app/.env b/sources/extra_files/app/.env index f36d9e7..2176a5b 100644 --- a/sources/extra_files/app/.env +++ b/sources/extra_files/app/.env @@ -25,7 +25,7 @@ MAIL_FROM_NAME="__MAIL_FROM_NAME__" MAIL_FROM_ADDRESS=__MAIL_FROM_ADDRESS__ MAIL_PASSWORD= -PHANTOMJS_CLOUD_KEY=a-demo-key-with-low-quota-per-ip-address +PHANTOMJS_BIN_PATH=/usr/bin/phantomjs PHANTOMJS_SECRET=__PHANTOMJS_KEY__ MAILGUN_DOMAIN=