aboutsummaryrefslogtreecommitdiff
path: root/scripts/upgrade
diff options
context:
space:
mode:
authorKay0u <pierre@kayou.io>2020-12-11 14:39:35 +0100
committerKay0u <pierre@kayou.io>2020-12-11 14:39:35 +0100
commita7b1f9a27caf415c3fca5715cc2fe3dd2f82ac62 (patch)
tree5cd4c32236c71cf96a1ec046ea0b738e7266fa5e /scripts/upgrade
parentb93733d7266f54d97eda4ccab3f28b4d799c095b (diff)
downloadmastodon_ynh-a7b1f9a27caf415c3fca5715cc2fe3dd2f82ac62.tar.gz
mastodon_ynh-a7b1f9a27caf415c3fca5715cc2fe3dd2f82ac62.tar.bz2
mastodon_ynh-a7b1f9a27caf415c3fca5715cc2fe3dd2f82ac62.zip
do not run bundle as root
Diffstat (limited to 'scripts/upgrade')
-rw-r--r--scripts/upgrade16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/upgrade b/scripts/upgrade
index 2914550..895049b 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -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.