mirror of
https://github.com/YunoHost-Apps/glitchsoc_ynh.git
synced 2024-09-03 19:15:59 +02:00
upgrade to ruby 2.6.1
This commit is contained in:
parent
cbbe9d3cc5
commit
c8a9c03212
6 changed files with 21 additions and 21 deletions
|
@ -1,2 +1,2 @@
|
|||
RAILS_ENV=production
|
||||
@daily cd __FINAL__PATH__/live && /opt/rbenv/versions/2.6.0/bin/bundle exec rake __USER__:media:remove_remote
|
||||
@daily cd __FINAL__PATH__/live && /opt/rbenv/versions/2.6.1/bin/bundle exec rake __USER__:media:remove_remote
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
Environment="RAILS_ENV=production"
|
||||
Environment="DB_POOL=25"
|
||||
Environment="MALLOC_ARENA_MAX=2"
|
||||
ExecStart=/opt/rbenv/versions/2.6.0/bin/bundle exec sidekiq -c 25
|
||||
ExecStart=/opt/rbenv/versions/2.6.1/bin/bundle exec sidekiq -c 25
|
||||
TimeoutSec=15
|
||||
Restart=always
|
||||
StandardError=syslog
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
WorkingDirectory=__FINALPATH__/live
|
||||
Environment="RAILS_ENV=production"
|
||||
Environment="PORT=__PORT_WEB__"
|
||||
ExecStart=/opt/rbenv/versions/2.6.0/bin/bundle exec puma -C config/puma.rb
|
||||
ExecStart=/opt/rbenv/versions/2.6.1/bin/bundle exec puma -C config/puma.rb
|
||||
ExecReload=/bin/kill -SIGUSR1 $MAINPID
|
||||
TimeoutSec=15
|
||||
Restart=always
|
||||
|
|
|
@ -160,9 +160,9 @@ ynh_system_user_create $app $final_path
|
|||
# INSTALLING RUBY AND BUNDLER
|
||||
#=================================================
|
||||
|
||||
ynh_install_ruby --ruby_version=2.6.0
|
||||
/opt/rbenv/versions/2.6.0/bin/gem update --system
|
||||
#/opt/rbenv/versions/2.6.0/bin/gem install bundler --no-document
|
||||
ynh_install_ruby --ruby_version=2.6.1
|
||||
/opt/rbenv/versions/2.6.1/bin/gem update --system
|
||||
#/opt/rbenv/versions/2.6.1/bin/gem install bundler --no-document
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
|
@ -199,12 +199,12 @@ chown -R "$app": "$final_path"
|
|||
|
||||
pushd "$final_path/live"
|
||||
ynh_use_nodejs
|
||||
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.0/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test
|
||||
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.1/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test
|
||||
sudo -u "$app" env PATH=$PATH yarn install --pure-lockfile
|
||||
sudo -u "$app" echo "SAFETY_ASSURED=1">> .env.production
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails db:migrate --quiet
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails assets:precompile --quiet
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails db:migrate --quiet
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails assets:precompile --quiet
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > acc.txt
|
||||
popd
|
||||
|
||||
|
|
|
@ -104,8 +104,8 @@ ynh_install_app_dependencies $pkg_dependencies
|
|||
# INSTALLING RUBY AND BUNDLER
|
||||
#=================================================
|
||||
|
||||
ynh_install_ruby --ruby_version=2.6.0
|
||||
/opt/rbenv/versions/2.6.0/bin/gem update --system
|
||||
ynh_install_ruby --ruby_version=2.6.1
|
||||
/opt/rbenv/versions/2.6.1/bin/gem update --system
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE POSTGRESQL DATABASE
|
||||
|
|
|
@ -187,9 +187,9 @@ ynh_system_user_create $app
|
|||
# INSTALLING RUBY AND BUNDLER
|
||||
#=================================================
|
||||
|
||||
ynh_install_ruby --ruby_version=2.6.0
|
||||
/opt/rbenv/versions/2.6.0/bin/gem update --system
|
||||
#/opt/rbenv/versions/2.6.0/bin/gem install bundler
|
||||
ynh_install_ruby --ruby_version=2.6.1
|
||||
/opt/rbenv/versions/2.6.1/bin/gem update --system
|
||||
#/opt/rbenv/versions/2.6.1/bin/gem install bundler
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
|
@ -221,20 +221,20 @@ chown -R "$app": "$final_path"
|
|||
pushd "$final_path/live"
|
||||
ynh_use_nodejs
|
||||
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
|
||||
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.0/bin/bundle install --deployment --without development test
|
||||
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.1/bin/bundle install --deployment --without development test
|
||||
else
|
||||
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.0/bin/bundle install --deployment --force --without development test
|
||||
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.1/bin/bundle install --deployment --force --without development test
|
||||
fi
|
||||
sudo -u "$app" env PATH=$PATH yarn install --pure-lockfile
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails assets:clean
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails assets:precompile
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rails db:migrate
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails assets:clean
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails assets:precompile
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails db:migrate
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl cache clear
|
||||
popd
|
||||
|
||||
# If vapid_private_key doesn't exist, retrieve it or create it
|
||||
if [[ -z "$vapid_private_key" ]]; then
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
|
||||
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
|
||||
vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K\w+" "$final_path/live/key.txt")
|
||||
vapid_public_key=$(grep -oP "VAPID_PUBLIC_KEY=\K\w+" "$final_path/live/key.txt")
|
||||
ynh_app_setting_set "$app" vapid_private_key "$vapid_private_key"
|
||||
|
|
Loading…
Reference in a new issue