1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/snserver_ynh.git synced 2024-09-03 20:26:22 +02:00

Update installer

This commit is contained in:
Fabian Wilkens 2021-03-20 13:48:42 +01:00
parent 70e22aae95
commit 1b27bd0e67
No known key found for this signature in database
GPG key ID: 23DFA025BB4E9FAB
3 changed files with 17 additions and 14 deletions

View file

@ -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
#=================================================

View file

@ -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

View file

@ -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