Skip to content

Commit

Permalink
Bundler now needs "jruby" on path as well for env
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfb committed Jan 16, 2025
1 parent 315f4f5 commit a913515
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

# BUNDLER_VERSION=$(fgrep -A1 'BUNDLED WITH' Gemfile.lock | tail -1 | sed -e 's/^ *//')
EDITOR_USER="tomcat"
JRUBY="/usr/local/jruby/bin/jruby"
JRUBY_PATH="/usr/local/jruby/bin"
JRUBY="${JRUBY_PATH}/jruby"

# make sure we can run jruby/bundle as $EDITOR_USER before doing anything
sudo -u $EDITOR_USER $JRUBY --version && sudo -u $EDITOR_USER $JRUBY -S bundle --version
sudo -u $EDITOR_USER $JRUBY --version && sudo -u $EDITOR_USER PATH="$JRUBY_PATH:$PATH" $JRUBY -S bundle --version
if [ $? -eq 0 ]; then
sudo -u $EDITOR_USER $JRUBY -S bundle install --deployment
sudo -u $EDITOR_USER PATH="$JRUBY_PATH:$PATH" $JRUBY -S bundle install --deployment
# Needed for asset pipeline:
sudo -u $EDITOR_USER $JRUBY -S bundle exec rake assets:precompile RAILS_ENV="production" RAILS_RELATIVE_URL_ROOT='/editor' RAILS_GROUPS="assets"
sudo -u $EDITOR_USER $JRUBY -S bundle exec cap local externals:setup
sudo -u $EDITOR_USER $JRUBY -S bundle exec rake db:migrate RAILS_ENV="production"
sudo -u $EDITOR_USER PATH="$JRUBY_PATH:$PATH" $JRUBY -S bundle exec rake assets:precompile RAILS_ENV="production" RAILS_RELATIVE_URL_ROOT='/editor' RAILS_GROUPS="assets"
sudo -u $EDITOR_USER PATH="$JRUBY_PATH:$PATH" $JRUBY -S bundle exec cap local externals:setup
sudo -u $EDITOR_USER PATH="$JRUBY_PATH:$PATH" $JRUBY -S bundle exec rake db:migrate RAILS_ENV="production"
sudo systemctl restart papyri.editor
fi

0 comments on commit a913515

Please sign in to comment.