diff options
| author | __cyp <cyp@rouquin.me> | 2017-05-06 18:52:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-06 18:52:21 +0200 |
| commit | e9741741cf8aa2697a04322455d298b16e3d31c6 (patch) | |
| tree | 4ab6c10f3453c3bdc34e1561ea758bad57e0f82e /scripts | |
| parent | d2673b8ea3943d18536fa9810ee2d555017e1238 (diff) | |
| parent | 1b76f0b4daeea40dbae1e5cccdb88d63b0914e97 (diff) | |
| download | mastodon_ynh-e9741741cf8aa2697a04322455d298b16e3d31c6.tar.gz mastodon_ynh-e9741741cf8aa2697a04322455d298b16e3d31c6.tar.bz2 mastodon_ynh-e9741741cf8aa2697a04322455d298b16e3d31c6.zip | |
Merge pull request #19 from nemsia/patch-2
[enh] Switch to tagged release
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/install | 6 | ||||
| -rw-r--r-- | scripts/upgrade | 14 |
2 files changed, 16 insertions, 4 deletions
diff --git a/scripts/install b/scripts/install index f5522df..3357c1d 100644 --- a/scripts/install +++ b/scripts/install @@ -85,13 +85,17 @@ sudo su -c "psql" postgres <<< \ ynh_psql_create_db_without_password "$app" sudo systemctl restart postgresql -# Download all Ruby source +# Download all sources rbenv, ruby and mastodon sudo su - $app <<CLONECOMMANDS git clone https://github.com/rbenv/rbenv.git $final_path/.rbenv git clone https://github.com/rbenv/ruby-build.git $final_path/.rbenv/plugins/ruby-build git clone https://github.com/tootsuite/mastodon.git $final_path/live CLONECOMMANDS +# Switch to tagged release +cd $final_path/live +sudo git checkout $(git tag | tail -n 1) + # Be king rewind (/var/cache/yunohost/from_file/scripts) popd diff --git a/scripts/upgrade b/scripts/upgrade index 07b3ee7..ab4bf58 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -37,12 +37,20 @@ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf # Stop Mastodon Services sudo systemctl stop mastodon-*.service -# Update Mastodon -sudo su - $app <<COMMANDS +# Download Mastodon +sudo su - $app <<PULLCOMMANDS pushd ~/live git fetch git pull https://github.com/tootsuite/mastodon.git master -git checkout $(git tag | tail -n 1) +PULLCOMMANDS + +# Switch branch to tagged release +cd $final_path/live +sudo git checkout $(git tag | tail -n 1) + +# Apply Mastodon upgrade +sudo su - $app <<COMMANDS +pushd ~/live bin/bundle install yarn install --pure-lockfile RAILS_ENV=production bundle exec rails assets:clean |
