aboutsummaryrefslogtreecommitdiff
path: root/scripts/upgrade
diff options
context:
space:
mode:
authoryalh76 <yalh@yahoo.com>2020-12-21 21:13:23 +0100
committerGitHub <noreply@github.com>2020-12-21 21:13:23 +0100
commit0bf67bb1f56306c96b17445f694e0957f3fbe87e (patch)
treec05ad7ec6344257370cd931c3886f893b0586e6c /scripts/upgrade
parent3b99dc9aabc73c433dfdde7371a85a270ae0d69b (diff)
parentb88b24c2d1b878fe04d6495052c5e0ef266f9061 (diff)
downloadmastodon_ynh-0bf67bb1f56306c96b17445f694e0957f3fbe87e.tar.gz
mastodon_ynh-0bf67bb1f56306c96b17445f694e0957f3fbe87e.tar.bz2
mastodon_ynh-0bf67bb1f56306c96b17445f694e0957f3fbe87e.zip
Merge pull request #247 from YunoHost-Apps/fix-bundle
Fix bundle
Diffstat (limited to 'scripts/upgrade')
-rw-r--r--scripts/upgrade24
1 files changed, 12 insertions, 12 deletions
diff --git a/scripts/upgrade b/scripts/upgrade
index 2914550..a045f46 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -94,7 +94,7 @@ fi
if [[ -z "$paperclip_secret" ]]; then
paperclip_secret=$(grep -oP "PAPERCLIP_SECRET=\K\w+" $config)
if [[ -z "$paperclip_secret" ]]; then
- paperclip_secret=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c128)
+ paperclip_secret=$(ynh_string_random --length=128)
fi
ynh_app_setting_set --app=$app --key=paperclip_secret --value="$paperclip_secret"
fi
@@ -103,7 +103,7 @@ fi
if [[ -z "$secret_key_base" ]]; then
secret_key_base=$(grep -oP "SECRET_KEY_BASE=\K\w+" $config)
if [[ -z "$secret_key_base" ]]; then
- secret_key_base=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c128)
+ secret_key_base=$(ynh_string_random --length=128)
fi
ynh_app_setting_set --app=$app --key=secret_key_base --value="$secret_key_base"
fi
@@ -112,7 +112,7 @@ fi
if [[ -z "$otp_secret" ]]; then
otp_secret=$(grep -oP "OTP_SECRET=\K\w+" $config)
if [[ -z "$otp_secret" ]]; then
- otp_secret=$(head -n128 /dev/urandom | tail -n +1 | tr -dc -d 'a-z0-9' | head -c128)
+ otp_secret=$(ynh_string_random --length=128)
fi
ynh_app_setting_set --app=$app --key=otp_secret --value="$otp_secret"
fi
@@ -284,14 +284,14 @@ chown -R "$app": "$final_path"
pushd "$final_path/live"
ynh_use_nodejs
- bundle config deployment 'true'
- bundle config without 'development test'
- bundle install -j$(getconf _NPROCESSORS_ONLN)
- yarn install --pure-lockfile
- RAILS_ENV=production bundle exec rails assets:clean
- RAILS_ENV=production bundle exec rails assets:precompile
- RAILS_ENV=production bundle exec rails db:migrate
- RAILS_ENV=production bin/tootctl cache clear
+ sudo -u $app PATH=$PATH $RBENV_ROOT/shims/bundle config deployment 'true'
+ sudo -u $app PATH=$PATH $RBENV_ROOT/shims/bundle config without 'development test'
+ sudo -u $app PATH=$PATH $RBENV_ROOT/shims/bundle install -j$(getconf _NPROCESSORS_ONLN)
+ sudo -u $app PATH=$PATH yarn install --pure-lockfile
+ sudo -u $app RAILS_ENV=production PATH=$PATH bin/bundle exec rails assets:clean
+ sudo -u $app RAILS_ENV=production PATH=$PATH bin/bundle exec rails assets:precompile
+ sudo -u $app RAILS_ENV=production PATH=$PATH bin/bundle exec rails db:migrate
+ sudo -u $app RAILS_ENV=production PATH=$PATH bin/tootctl cache clear
popd
# Recalculate and store the checksum of the file for the next upgrade.
@@ -352,7 +352,7 @@ fi
ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name=${app}-web --action="start" --log_path=systemd --line_match="Listening on tcp"
-ynh_systemd_action --service_name=${app}-sidekiq --action="start" --log_path=systemd --line_match="Starting processing"
+ynh_systemd_action --service_name=${app}-sidekiq --action="start" --log_path=systemd --line_match="Schedules Loaded"
ynh_systemd_action --service_name=${app}-streaming --action="start" --log_path=systemd --line_match="Worker 1 now listening"
#=================================================