From 1b27bd0e672f309307bcc15aeefc2ae78396a023 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sat, 20 Mar 2021 13:48:42 +0100 Subject: [PATCH] Update installer --- scripts/install | 15 ++++++++------- scripts/restore | 1 + scripts/upgrade | 15 ++++++++------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/scripts/install b/scripts/install index 2b55862..1727de3 100755 --- a/scripts/install +++ b/scripts/install @@ -124,6 +124,7 @@ ynh_script_progression --message="Installing Ruby...( This may take a while... ) ynh_install_ruby --ruby_version=$RUBY_VERSION /opt/rbenv/versions/$RUBY_VERSION/bin/gem update --system --no-document +/opt/rbenv/versions/$RUBY_VERSION/bin/gem install bundler --no-document #================================================= # Setup @@ -161,15 +162,15 @@ ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --targ #================================================= ynh_script_progression --message="Installing Standard Notes - Synicing Server..." --weight=93 -chown -R "$app": "$final_path" +chown -R $app: "$final_path" pushd "$final_path/live" - exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set path 'vendor/bundle' - exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set with 'development' - exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle install - exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails db:migrate --quiet - exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails db:seed --quiet -# exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet + exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set --local path 'vendor/bundle' + exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set with 'development' + exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) + exec_as $app RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails db:migrate --quiet + exec_as $app RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails db:seed --quiet +# exec_as $app RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet popd #================================================= diff --git a/scripts/restore b/scripts/restore index 5e401db..2e211e5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -106,6 +106,7 @@ ynh_script_progression --message="Installing Ruby...( This may take a while... ) ynh_install_ruby --ruby_version=$RUBY_VERSION /opt/rbenv/versions/$RUBY_VERSION/bin/gem update --system --no-document +/opt/rbenv/versions/$RUBY_VERSION/bin/gem install bundler --no-document #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index c849af8..59c4749 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -221,6 +221,7 @@ ynh_script_progression --message="Installing Ruby...( This may take a while... ) ynh_install_ruby --ruby_version=$RUBY_VERSION /opt/rbenv/versions/$RUBY_VERSION/bin/gem update --system --no-document +/opt/rbenv/versions/$RUBY_VERSION/bin/gem install bundler --no-document #================================================= # CREATE DEDICATED USER @@ -261,15 +262,15 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Installing Standard Notes - Synicing Server..." --weight=93 - chown -R "$app": "$final_path" + chown -R $app: "$final_path" pushd "$final_path/live" - exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set path 'vendor/bundle' - exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set with 'development' - exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle install - exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails db:migrate --quiet - exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails db:seed --quiet -# exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet + exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set --local path 'vendor/bundle' + exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set with 'development' + exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) + exec_as $app RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails db:migrate --quiet + exec_as $app RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails db:seed --quiet +# exec_as $app RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet popd fi