From 64d3147a7b68f9e94f231b9a8aa6e9199b2824aa Mon Sep 17 00:00:00 2001 From: nemsia Date: Thu, 31 May 2018 13:41:03 +0200 Subject: Yunohost 3.0 Stretch app upgrade (#85) * Ready to Debian Stretch * rb 2.5.1 on install * Yarn install on root * Ready to mastodon 2.4.1 --- scripts/backup | 7 ++++--- scripts/install | 44 +++++++++++++++++++++++++++-------------- scripts/remove | 15 ++++++-------- scripts/restore | 61 ++++++++++++++++++++++++++++++++++++--------------------- scripts/upgrade | 8 ++++---- 5 files changed, 82 insertions(+), 53 deletions(-) (limited to 'scripts') diff --git a/scripts/backup b/scripts/backup index e4a5bba..b7ff222 100644 --- a/scripts/backup +++ b/scripts/backup @@ -32,7 +32,10 @@ ynh_backup "/etc/cron.d/${app}" "cron.conf" ynh_backup "/etc/systemd/system/mastodon-web.service" "systemd_web.service" ynh_backup "/etc/systemd/system/mastodon-sidekiq.service" "systemd_sidekiq.service" ynh_backup "/etc/systemd/system/mastodon-streaming.service" "systemd_streaming.service" -ynh_backup "/etc/apt/sources.list.d/backports.list" "apt_backports.list" +debian_version=$(lsb_release -c -s) +if [[ $debian_version = jessie ]]; then + ynh_backup "/etc/apt/sources.list.d/backports.list" "apt_backports.list" +fi ynh_backup "/etc/apt/sources.list.d/yarn.list" "apt_yarn.list" # final_path on nginx @@ -43,5 +46,3 @@ sudo su - postgres < mastodon_db.sql COMMANDS ynh_backup "/var/lib/postgresql/${app}_db.sql" "${app}_db.sql" -# Fix backup fail on yunohost 2.6 -#ynh_secure_remove /var/lib/postgresql/mastodon_db.sql diff --git a/scripts/install b/scripts/install index 3d5172f..d92e0ed 100644 --- a/scripts/install +++ b/scripts/install @@ -47,7 +47,7 @@ ynh_package_install imagemagick libpq-dev libxml2-dev libxslt1-dev file curl apt ynh_package_install redis-server redis-tools # Install postgresql -ynh_package_install postgresql postgresql-contrib postgresql-server-dev-9.4 +ynh_package_install postgresql postgresql-contrib postgresql-server-dev-all # Install Ruby ynh_package_install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev @@ -59,14 +59,23 @@ if [[ $arch = arm* ]]; then sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 fi -# Install source.list debian package backports & yarn -sudo cp ../conf/backports.list /etc/apt/sources.list.d/ +# Install source.list debian yarn package sudo curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - sudo cp ../conf/yarn.list /etc/apt/sources.list.d/ -ynh_package_update -# Install debian package backports +# Install source.list debian jessie package backports +debian_version=$(lsb_release -c -s) +if [[ $debian_version = jessie ]]; then +sudo cp ../conf/backports.list /etc/apt/sources.list.d/ +ynh_package_update sudo apt-get -t jessie-backports -y install ffmpeg +else +ynh_package_update +ynh_package_install ffmpeg +fi + +# Install Yarn +ynh_package_install yarn # Creates the destination directory and stores its location. ynh_app_setting_set $app final_path $final_path @@ -76,9 +85,6 @@ pushd /opt curl -sL https://deb.nodesource.com/setup_6.x | sudo bash - sudo apt-get -y install nodejs -# Install Yarn -ynh_package_install yarn - # Set UTF8 encoding by default sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='false' where datname='template1';" @@ -122,22 +128,26 @@ COMMANDS # Install ruby-build sudo su - $app <> .env.production RAILS_ENV=production bin/bundle exec rails db:setup -RAILS_ENV=production bin/bundle exec rails --trace assets:precompile CCOMMANDS +# Rails precompile on root +pushd $final_path/live +RAILS_ENV=production bin/bundle exec rails --trace assets:precompile +popd + # init rbenv & create bundle sudo su - $app <