From 7dc905542a19caab58eb5769165d7b1426492f8c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 14 May 2019 21:04:05 +0200 Subject: [PATCH] Cleanup dependencies --- scripts/_common.sh | 4 ++-- scripts/install | 17 +---------------- scripts/restore | 18 ++---------------- scripts/upgrade | 15 +++++---------- 4 files changed, 10 insertions(+), 44 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 4a70d0b..904553d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,8 +5,8 @@ #================================================= # dependencies used by the app -#pkg_dependencies="imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core g++ libprotobuf-dev protobuf-compiler pkg-config gcc autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev nginx redis-server redis-tools postgresql postgresql-contrib certbot yarn libidn11-dev libicu-dev libjemalloc-dev" -pkg_dependencies="imagemagick libpq-dev libxml2-dev libxslt1-dev file curl apt-transport-https pkg-config libprotobuf-dev protobuf-compiler libicu-dev libidn11-dev redis-server redis-tools postgresql autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev ffmpeg yarn" +#pkg_dependencies="imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core g++ libprotobuf-dev protobuf-compiler pkg-config nodejs gcc autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev nginx redis-server redis-tools postgresql postgresql-contrib certbot python-certbot-nginx yarn libidn11-dev libicu-dev libjemalloc-dev" + pkg_dependencies="imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core g++ libprotobuf-dev protobuf-compiler pkg-config gcc autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev redis-server redis-tools postgresql postgresql-contrib libidn11-dev libicu-dev libjemalloc-dev curl apt-transport-https" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index ff03433..2742e1d 100644 --- a/scripts/install +++ b/scripts/install @@ -88,24 +88,9 @@ ynh_app_setting_set --app=$app --key=port_stream --value=$port_stream #================================================= ynh_script_progression --message="Installing dependencies..." --weight=86 -# Import debian archive pubkey, need on ARM arch -arch=$(uname -m) -if [[ "$arch" = arm* ]]; then - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553 - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 -fi - -# Install extra_repo debian package backports & yarn -if [ "$(lsb_release --codename --short)" == "jessie" ]; then - ynh_install_extra_repo --repo="deb http://httpredir.debian.org/debian jessie-backports main" --append -fi - -ynh_install_extra_repo --repo="deb https://dl.yarnpkg.com/debian/ stable main" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" --append - -# install nodejs ynh_install_nodejs --nodejs_version="8" - ynh_install_app_dependencies $pkg_dependencies +ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # CREATE A POSTGRESQL DATABASE diff --git a/scripts/restore b/scripts/restore index e85815c..b26661f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -85,23 +85,9 @@ chown -R $app: $final_path #================================================= ynh_script_progression --message="Reinstalling dependencies..." --weight=63 -# Import debian archive pubkey, need on ARM arch -arch=$(uname -m) -if [[ "$arch" = arm* ]]; then - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553 - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 -fi - -# Install extra_repo debian package backports & yarn -if [ "$(lsb_release --codename --short)" == "jessie" ]; then - ynh_install_extra_repo --repo="deb http://httpredir.debian.org/debian jessie-backports main" --append -fi -ynh_install_extra_repo --repo="deb https://dl.yarnpkg.com/debian/ stable main" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" --append - -# install nodejs ynh_install_nodejs --nodejs_version="8" - -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies +ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # INSTALLING RUBY AND BUNDLER diff --git a/scripts/upgrade b/scripts/upgrade index 7562d85..93cb3f0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -104,6 +104,9 @@ if [[ -z "$vapid_private_key" ]]; then ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key" fi +#Remove previous added repository +ynh_remove_extra_repo + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -166,17 +169,9 @@ ynh_add_nginx_config 'port_web port_stream' #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=24 -# Install extra_repo debian package backports & yarn -if [ "$(lsb_release --codename --short)" == "jessie" ]; then - ynh_install_extra_repo --repo="deb http://httpredir.debian.org/debian jessie-backports main" --append -fi -ynh_install_extra_repo --repo="deb https://dl.yarnpkg.com/debian/ stable main" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" --append - -# Install nodejs ynh_install_nodejs --nodejs_version="8" - -# TODO: use the same mecanism with other files -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies +ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # CREATE DEDICATED USER