aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorÉric Gaspar <46165813+ericgaspar@users.noreply.github.com>2022-01-06 15:53:14 +0100
committerGitHub <noreply@github.com>2022-01-06 15:53:14 +0100
commit79914a6f08ad0b16774785f3d491f9567bc1de2d (patch)
tree3ccb0febe099bd46d73e4a4bbd032327c9f33cd3 /scripts
parentdf3848850ebfb1fabc58858e2559a841b40ac9e4 (diff)
parentdac17de1453a284095fa5a5e2412b553f28a83af (diff)
downloadmastodon_ynh-79914a6f08ad0b16774785f3d491f9567bc1de2d.tar.gz
mastodon_ynh-79914a6f08ad0b16774785f3d491f9567bc1de2d.tar.bz2
mastodon_ynh-79914a6f08ad0b16774785f3d491f9567bc1de2d.zip
Merge pull request #289 from Tagadda/fix-install
Upgrade to 3.4.4
Diffstat (limited to 'scripts')
-rw-r--r--scripts/_common.sh2
-rw-r--r--scripts/install16
-rw-r--r--scripts/restore9
-rw-r--r--scripts/upgrade8
4 files changed, 16 insertions, 19 deletions
diff --git a/scripts/_common.sh b/scripts/_common.sh
index b6f4796..c861376 100644
--- a/scripts/_common.sh
+++ b/scripts/_common.sh
@@ -5,7 +5,7 @@
#=================================================
# 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 libgdbm3|libgdbm6 libgdbm-dev redis-server redis-tools postgresql postgresql-contrib libidn11-dev libicu-dev libjemalloc-dev curl apt-transport-https"
+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|libgdbm6 libgdbm-dev redis-tools redis-server postgresql postgresql-contrib libidn11-dev libicu-dev libjemalloc-dev curl apt-transport-https"
MEMORY_NEEDED="2560"
diff --git a/scripts/install b/scripts/install
index 2a1edf4..e6960d1 100644
--- a/scripts/install
+++ b/scripts/install
@@ -75,8 +75,8 @@ ynh_app_setting_set --app=$app --key=port_stream --value=$port_stream
#=================================================
ynh_script_progression --message="Installing dependencies..."
-ynh_install_app_dependencies $pkg_dependencies
-ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
+ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
+ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
ynh_install_ruby --ruby_version=$RUBY_VERSION
@@ -207,13 +207,13 @@ pushd "$final_path/live"
sudo -u $app $ynh_ruby_load_path bin/bundle config without 'development test'
sudo -u $app $ynh_ruby_load_path bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
ynh_use_nodejs
- sudo -u $app $ynh_node_load_PATH yarn install --pure-lockfile
+ ynh_exec_warn_less sudo -u $app $ynh_node_load_PATH yarn install --pure-lockfile
echo "SAFETY_ASSURED=1">> $config
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails db:setup --quiet
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails assets:precompile --quiet
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > /dev/null
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl accounts modify "$admin" --approve
+ ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails db:setup --quiet
+ ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails assets:precompile --quiet
+ ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
+ ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > /dev/null
+ ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl accounts modify "$admin" --approve
popd
vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K.+" "$final_path/live/key.txt")
diff --git a/scripts/restore b/scripts/restore
index 7a3808b..aacb7f0 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -41,10 +41,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
-ynh_webpath_available --domain=$domain --path_url=$path_url \
- || ynh_die --message="Path not available: ${domain}${path_url}"
-test ! -d $final_path \
- || ynh_die --message="There is already a directory: $final_path "
+test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS
@@ -104,8 +101,8 @@ ynh_restore_file --origin_path="/etc/cron.d/$app"
#=================================================
ynh_script_progression --message="Reinstalling dependencies..."
-ynh_install_app_dependencies $pkg_dependencies
-ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
+ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
+ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
ynh_install_ruby --ruby_version=$RUBY_VERSION
diff --git a/scripts/upgrade b/scripts/upgrade
index 0653f76..a386514 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -269,10 +269,10 @@ pushd "$final_path/live"
sudo -u $app $ynh_ruby_load_path bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
ynh_use_nodejs
sudo -u $app $ynh_node_load_PATH yarn install --pure-lockfile
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails assets:clean
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails assets:precompile
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails db:migrate
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl cache clear
+ ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails assets:clean
+ ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails assets:precompile
+ ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails db:migrate
+ ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl cache clear
popd
#=================================================