mirror of
https://github.com/YunoHost-Apps/glitchsoc_ynh.git
synced 2024-09-03 19:15:59 +02:00
Merge pull request #20 from nemsia/patch-3
[fix] Restore pg dump and make jenkins happy
This commit is contained in:
commit
b25cc8f544
1 changed files with 13 additions and 2 deletions
|
@ -101,8 +101,19 @@ RAILS_ENV=production bin/bundle exec rails db:migrate
|
|||
RAILS_ENV=production bin/bundle exec rails assets:precompile
|
||||
RCOMMANDS
|
||||
|
||||
# restore database
|
||||
sudo psql mastodon_production < $YNH_APP_BACKUP_DIR/mastodon_db.sql
|
||||
# copy database dump
|
||||
sudo cp $YNH_APP_BACKUP_DIR/mastodon_db.sql $final_path
|
||||
sudo chmod a+r $final_path/mastodon_db.sql
|
||||
|
||||
# Restore database dump
|
||||
sudo su - $app <<RECOMMANDS
|
||||
dropdb mastodon_production
|
||||
createdb mastodon_production
|
||||
psql mastodon_production < $final_path/mastodon_db.sql
|
||||
RECOMMANDS
|
||||
|
||||
# Remove dump
|
||||
ynh_secure_remove $final_path/mastodon_db.sql
|
||||
|
||||
# Create symlink for ruby
|
||||
sudo ln -s /opt/mastodon/.rbenv/versions/2.4.1/bin/ruby /usr/bin/ruby || true
|
||||
|
|
Loading…
Reference in a new issue