-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathupdate.sh
executable file
·39 lines (30 loc) · 976 Bytes
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
## Run on only your responsibilitity.##
sudo echo ""
SKIP_POST_DEPLOYMENT_MIGRATIONS=true
export NODE_OPTIONS="--max-old-space-size=1024"
# Pull Mastodon
cd ~/live
git fetch
git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)
# Reget Yarnpkg pubkey
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
# Update pkg(s)
cd ~/.rbenv/plugins/ruby-build && git pull
echo N | rbenv install $(cat ~/live/.ruby-version)
rbenv global $(cat ~/live/.ruby-version)
cd ~/live
gem update --system
gem install bundler
bundle update
bundle install
yarn install
# Migrate
RAILS_ENV=production bundle exec rails assets:clobber
RAILS_ENV=production bundle exec rails db:migrate
RAILS_ENV=production bundle exec rails assets:precompile
sudo systemctl restart mastodon-*.service
RAILS_ENV=production ~/live/bin/tootctl cache clear
# Migrate again
RAILS_ENV=production bundle exec rails db:migrate
sudo systemctl restart mastodon-*.service