added update scripts for dev and prod envs

Signed-off-by: Baptiste Lemoine <contact@cipherbliss.com>
This commit is contained in:
Baptiste Lemoine 2020-02-12 10:02:59 +01:00
commit b3c8105a52
3 changed files with 47 additions and 0 deletions

13
check_services.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
echo "########## time to check the services, this script must be run with an user able to manage services, someone with sudo rights for example"
sudo service postgresql status
sudo service mastodon-* status
echo "########## run:
sudo service mastodon-* restart
and check that everything is working fine
sudo journalctl -feu mastodon-*
"

18
update_dev.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
## script must be run with the mastodon user
echo "ruby version is":
ruby -v
echo "needed version is":
cat .ruby-version
echo "########## time to update mastodon. you need to pull your git branch before running this script."
git remote -v
git pull origin master
echo "########## install back end updates "
bundle install
bundle exec rake db:migrate
echo "########## install front end updates "
bundle exec rails assets:precompile
echo "########## check the services "
echo "########## now time to restart web services "
foreman start

16
update_prod.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash
## script must be run with the mastodon user
cd /home/mastodon/live/
echo "ruby version is":
ruby -v
echo "needed version is":
cat .ruby-version
echo "########## time to update mastodon. you need to pull your git branch before running this script."
git remote -v
echo "########## install back end updates "
RAILS_ENV=production bundle install
RAILS_ENV=production bundle exec rake db:migrate
echo "########## install front end updates "
RAILS_ENV=production bundle exec rails assets:precompile
echo "########## check the services "
echo "########## now time to restart web services "