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.5

This commit is contained in:
yalh76 2019-10-07 22:54:13 +02:00
parent bf58460ad1
commit 45573a61cd
8 changed files with 28 additions and 28 deletions

View file

@ -1,2 +1,2 @@
RAILS_ENV=production RAILS_ENV=production
@daily cd __FINAL__PATH__/live && /opt/rbenv/versions/2.6.1/bin/bundle exec rake __USER__:media:remove_remote @daily cd __FINAL__PATH__/live && /opt/rbenv/versions/2.6.5/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.1/bin/bundle exec sidekiq -c 25 ExecStart=/opt/rbenv/versions/2.6.5/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.1/bin/bundle exec puma -C config/puma.rb ExecStart=/opt/rbenv/versions/2.6.5/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

@ -7,7 +7,7 @@
#================================================= #=================================================
source _common.sh source _common.sh
source ynh_install_ruby source ynh_install_ruby__2
source ynh_add_extra_apt_repos__3 source ynh_add_extra_apt_repos__3
source ynh_send_readme_to_admin__2 source ynh_send_readme_to_admin__2
source ynh_add_swap source ynh_add_swap
@ -146,9 +146,9 @@ ynh_add_swap --size=$swap_needed
#================================================= #=================================================
ynh_script_progression --message="Installing Ruby..." --weight=424 ynh_script_progression --message="Installing Ruby..." --weight=424
ynh_install_ruby --ruby_version=2.6.1 ynh_install_ruby --ruby_version=2.6.5
/opt/rbenv/versions/2.6.1/bin/gem update --system /opt/rbenv/versions/2.6.5/bin/gem update --system
#/opt/rbenv/versions/2.6.1/bin/gem install bundler --no-document #/opt/rbenv/versions/2.6.5/bin/gem install bundler --no-document
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
@ -186,12 +186,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.1/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.5/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.1/bin/bundle exec rails db:migrate --quiet sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/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.5/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 /opt/rbenv/versions/2.6.5/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

@ -7,7 +7,7 @@
#================================================= #=================================================
source _common.sh source _common.sh
source ynh_install_ruby source ynh_install_ruby__2
source ynh_add_extra_apt_repos__3 source ynh_add_extra_apt_repos__3
source ynh_add_swap source ynh_add_swap
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers

View file

@ -8,7 +8,7 @@
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts #Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source ../settings/scripts/ynh_install_ruby source ../settings/scripts/ynh_install_ruby__2
source ../settings/scripts/ynh_add_extra_apt_repos__3 source ../settings/scripts/ynh_add_extra_apt_repos__3
source ../settings/scripts/ynh_add_swap source ../settings/scripts/ynh_add_swap
source ../settings/scripts/ynh_check_ram source ../settings/scripts/ynh_check_ram
@ -112,8 +112,8 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
#================================================= #=================================================
ynh_script_progression --message="Installing Ruby..." --weight=393 ynh_script_progression --message="Installing Ruby..." --weight=393
ynh_install_ruby --ruby_version=2.6.1 ynh_install_ruby --ruby_version=2.6.5
/opt/rbenv/versions/2.6.1/bin/gem update --system /opt/rbenv/versions/2.6.5/bin/gem update --system
#================================================= #=================================================
# RESTORE THE POSTGRESQL DATABASE # RESTORE THE POSTGRESQL DATABASE

View file

@ -7,7 +7,7 @@
#================================================= #=================================================
source _common.sh source _common.sh
source ynh_install_ruby source ynh_install_ruby__2
source ynh_add_extra_apt_repos__3 source ynh_add_extra_apt_repos__3
source ynh_add_swap source ynh_add_swap
source ynh_check_ram source ynh_check_ram
@ -228,9 +228,9 @@ ynh_add_swap --size=$swap_needed
#================================================= #=================================================
ynh_script_progression --message="Installing Ruby..." --weight=424 ynh_script_progression --message="Installing Ruby..." --weight=424
ynh_install_ruby --ruby_version=2.6.1 ynh_install_ruby --ruby_version=2.6.5
/opt/rbenv/versions/2.6.1/bin/gem update --system /opt/rbenv/versions/2.6.5/bin/gem update --system
#/opt/rbenv/versions/2.6.1/bin/gem install bundler #/opt/rbenv/versions/2.6.5/bin/gem install bundler
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
@ -267,14 +267,14 @@ 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.1/bin/bundle install --deployment --without development test sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.5/bin/bundle install --deployment --without development test
else else
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.1/bin/bundle install --deployment --force --without development test sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.5/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.1/bin/bundle exec rails assets:clean sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/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.5/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 /opt/rbenv/versions/2.6.5/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

View file

@ -15,15 +15,15 @@ ynh_install_rbenv () {
echo "Installation of rbenv - ruby version management" >&2 echo "Installation of rbenv - ruby version management" >&2
# Build an app.src for rbenv # Build an app.src for rbenv
mkdir -p "../conf" mkdir -p "../conf"
echo "SOURCE_URL=https://github.com/rbenv/rbenv/archive/v1.1.1.tar.gz echo "SOURCE_URL=https://github.com/rbenv/rbenv/archive/v1.1.2.tar.gz
SOURCE_SUM=41f1a60714c55eceb21d692a469aee1ec4f46bba351d0dfcb0c660ff9cf1a1c9" > "../conf/rbenv.src" SOURCE_SUM=80ad89ffe04c0b481503bd375f05c212bbc7d44ef5f5e649e0acdf25eba86736" > "../conf/rbenv.src"
# Download and extract rbenv # Download and extract rbenv
ynh_setup_source "$rbenv_install_dir" rbenv ynh_setup_source "$rbenv_install_dir" rbenv
# Build an app.src for ruby-build # Build an app.src for ruby-build
mkdir -p "../conf" mkdir -p "../conf"
echo "SOURCE_URL=https://github.com/rbenv/ruby-build/archive/v20190314.tar.gz echo "SOURCE_URL=https://github.com/rbenv/ruby-build/archive/v20191004.tar.gz
SOURCE_SUM=2cc0f9fdb232042e71edad93a5c3ae108bcd090ea0b6db4e5bb6325547e07968" > "../conf/ruby-build.src" SOURCE_SUM=6f053957acb0af6d621ebf2b9dacc9c265844b2dc6842a021eb10f0a70094fe8" > "../conf/ruby-build.src"
# Download and extract ruby-build # Download and extract ruby-build
ynh_setup_source "$rbenv_install_dir/plugins/ruby-build" ruby-build ynh_setup_source "$rbenv_install_dir/plugins/ruby-build" ruby-build