1
0
Fork 0
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:
yalh76 2019-05-10 17:28:21 +02:00
parent cbbe9d3cc5
commit c8a9c03212
6 changed files with 21 additions and 21 deletions

View file

@ -1,2 +1,2 @@
RAILS_ENV=production 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

View file

@ -9,7 +9,7 @@
Environment="RAILS_ENV=production" Environment="RAILS_ENV=production"
Environment="DB_POOL=25" Environment="DB_POOL=25"
Environment="MALLOC_ARENA_MAX=2" 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 TimeoutSec=15
Restart=always Restart=always
StandardError=syslog StandardError=syslog

View file

@ -8,7 +8,7 @@
WorkingDirectory=__FINALPATH__/live WorkingDirectory=__FINALPATH__/live
Environment="RAILS_ENV=production" Environment="RAILS_ENV=production"
Environment="PORT=__PORT_WEB__" 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 ExecReload=/bin/kill -SIGUSR1 $MAINPID
TimeoutSec=15 TimeoutSec=15
Restart=always Restart=always

View file

@ -160,9 +160,9 @@ ynh_system_user_create $app $final_path
# INSTALLING RUBY AND BUNDLER # INSTALLING RUBY AND BUNDLER
#================================================= #=================================================
ynh_install_ruby --ruby_version=2.6.0 ynh_install_ruby --ruby_version=2.6.1
/opt/rbenv/versions/2.6.0/bin/gem update --system /opt/rbenv/versions/2.6.1/bin/gem update --system
#/opt/rbenv/versions/2.6.0/bin/gem install bundler --no-document #/opt/rbenv/versions/2.6.1/bin/gem install bundler --no-document
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
@ -199,12 +199,12 @@ chown -R "$app": "$final_path"
pushd "$final_path/live" pushd "$final_path/live"
ynh_use_nodejs 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" env PATH=$PATH yarn install --pure-lockfile
sudo -u "$app" echo "SAFETY_ASSURED=1">> .env.production 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.1/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.1/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 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 sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > acc.txt
popd popd

View file

@ -104,8 +104,8 @@ ynh_install_app_dependencies $pkg_dependencies
# INSTALLING RUBY AND BUNDLER # INSTALLING RUBY AND BUNDLER
#================================================= #=================================================
ynh_install_ruby --ruby_version=2.6.0 ynh_install_ruby --ruby_version=2.6.1
/opt/rbenv/versions/2.6.0/bin/gem update --system /opt/rbenv/versions/2.6.1/bin/gem update --system
#================================================= #=================================================
# RESTORE THE POSTGRESQL DATABASE # RESTORE THE POSTGRESQL DATABASE

View file

@ -187,9 +187,9 @@ ynh_system_user_create $app
# INSTALLING RUBY AND BUNDLER # INSTALLING RUBY AND BUNDLER
#================================================= #=================================================
ynh_install_ruby --ruby_version=2.6.0 ynh_install_ruby --ruby_version=2.6.1
/opt/rbenv/versions/2.6.0/bin/gem update --system /opt/rbenv/versions/2.6.1/bin/gem update --system
#/opt/rbenv/versions/2.6.0/bin/gem install bundler #/opt/rbenv/versions/2.6.1/bin/gem install bundler
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
@ -221,20 +221,20 @@ chown -R "$app": "$final_path"
pushd "$final_path/live" pushd "$final_path/live"
ynh_use_nodejs ynh_use_nodejs
if [ "$(lsb_release --codename --short)" == "jessie" ]; then 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 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 fi
sudo -u "$app" env PATH=$PATH yarn install --pure-lockfile 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.1/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.1/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 db:migrate
sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl cache clear sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl cache clear
popd popd
# If vapid_private_key doesn't exist, retrieve it or create it # If vapid_private_key doesn't exist, retrieve it or create it
if [[ -z "$vapid_private_key" ]]; then 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_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") 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" ynh_app_setting_set "$app" vapid_private_key "$vapid_private_key"