1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/glitchsoc_ynh.git synced 2024-09-03 19:15:59 +02:00

Upgrade 2.4 (#79)

* Upgrade rb to 2.5.1

* Update upgrade

* Fix 2.3.3

* Add trace on assets:precompile

* Yarn install and precompile

Update 2.4 need root to yarn install and precompile, 
Temporary bad fix.

* Update upgrade

* Fix migrate

* Update README.md

* Update manifest.json
This commit is contained in:
nemsia 2018-05-23 00:08:40 +02:00 committed by GitHub
parent 1d7613889c
commit a6d9ee92f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 16 deletions

View file

@ -1,6 +1,6 @@
# Mastodon for YunoHost # Mastodon for YunoHost
[![Latest Version](https://img.shields.io/badge/version-2.2.0-green.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/releases) [![Latest Version](https://img.shields.io/badge/version-2.4.0-green.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/releases)
[![Status](https://img.shields.io/badge/status-testing-yellow.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/milestones) [![Status](https://img.shields.io/badge/status-testing-yellow.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/milestones)
[![Dependencies](https://img.shields.io/badge/dependencies-includes-lightgrey.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh#dependencies) [![Dependencies](https://img.shields.io/badge/dependencies-includes-lightgrey.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh#dependencies)
[![GitHub license](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/YunoHost-Apps/mastodon_ynh/master/LICENSE) [![GitHub license](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/YunoHost-Apps/mastodon_ynh/master/LICENSE)

View file

@ -9,7 +9,7 @@
"en": "Mastodon is a free, open-source social network.", "en": "Mastodon is a free, open-source social network.",
"fr": "Mastodon est un réseau social gratuit et open source." "fr": "Mastodon est un réseau social gratuit et open source."
}, },
"version": "2.2.0", "version": "2.4.0",
"url": "https://github.com/tootsuite/mastodon", "url": "https://github.com/tootsuite/mastodon",
"license": "AGPL v3.0", "license": "AGPL v3.0",
"maintainer": { "maintainer": {

View file

@ -67,35 +67,41 @@ fi
# add additional package for upgrade # add additional package for upgrade
ynh_package_install pkg-config libprotobuf-dev protobuf-compiler libicu-dev libidn11-dev postgresql-server-dev-9.4 ynh_package_install pkg-config libprotobuf-dev protobuf-compiler libicu-dev libidn11-dev postgresql-server-dev-9.4
# Install ruby 2.5.0 for release 2.0 # Install ruby 2.5.1 for release 2.4.0
sudo su - $app <<RCOMMANDS sudo su - $app <<RCOMMANDS
cd $final_path/.rbenv && git pull && cd - cd $final_path/.rbenv && git pull && cd -
cd $final_path/.rbenv/plugins/ruby-build && git pull && cd - cd $final_path/.rbenv/plugins/ruby-build && git pull && cd -
$final_path/.rbenv/bin/rbenv install 2.5.0 || true $final_path/.rbenv/bin/rbenv install 2.5.1 || true
$final_path/.rbenv/versions/2.5.0/bin/ruby -v $final_path/.rbenv/versions/2.5.1/bin/ruby -v
RCOMMANDS RCOMMANDS
# Create symlink for ruby 2.5.0 # Create symlink for ruby 2.5.1
sudo rm /usr/bin/ruby || true sudo rm /usr/bin/ruby || true
sudo ln -s $final_path/.rbenv/versions/2.5.0/bin/ruby /usr/bin/ruby || true sudo ln -s $final_path/.rbenv/versions/2.5.1/bin/ruby /usr/bin/ruby || true
# Install Mastodon # Install Mastodon
sudo su - $app <<MCOMMANDS sudo su - $app <<MCOMMANDS
pushd ~/live pushd ~/live
$final_path/.rbenv/versions/2.5.0/bin/gem install bundler $final_path/.rbenv/versions/2.5.1/bin/gem install bundler
bin/bundle install --deployment --without development test $final_path/.rbenv/versions/2.5.1/bin/bundle install --deployment --without development test
yarn install --pure-lockfile #yarn install --pure-lockfile
MCOMMANDS MCOMMANDS
pushd $final_path/live
yarn install --pure-lockfile
popd
# Apply Mastodon upgrade # Apply Mastodon upgrade
sudo su - $app <<COMMANDS pushd $final_path/live
RAILS_ENV=production $final_path/.rbenv/versions/2.5.1/bin/bundle exec rails assets:clean
RAILS_ENV=production $final_path/.rbenv/versions/2.5.1/bin/bundle exec rails assets:precompile --trace
sudo su - $app <<UCOMMANDS
pushd ~/live pushd ~/live
RAILS_ENV=production bundle exec rails assets:clean RAILS_ENV=production $final_path/.rbenv/versions/2.5.1/bin/bundle exec rails db:migrate
RAILS_ENV=production bundle exec rails assets:precompile
RAILS_ENV=production bundle exec rails db:migrate
# Upgrade to 2.2.0 # Upgrade to 2.2.0
RAILS_ENV=production bundle exec rails mastodon:maintenance:remove_regeneration_markers RAILS_ENV=production $final_path/.rbenv/versions/2.5.1/bin/bundle exec rails mastodon:maintenance:remove_regeneration_markers
COMMANDS UCOMMANDS
# Restart Mastodon # Restart Mastodon
sudo systemctl start mastodon-*.service sudo systemctl start mastodon-*.service