Created
October 10, 2019 16:29
-
-
Save YarikST/8ed537fe9f5a442855ca91e373287dfc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo nano /usr/sbin/pull | |
#!/bin/bash | |
# Load RVM into a shell session *as a function* | |
printf "Load RVM.\n" | |
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then | |
# First try to load from a user install | |
source "$HOME/.rvm/scripts/rvm" | |
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then | |
# Then try to load from a root install | |
source "/usr/local/rvm/scripts/rvm" | |
else | |
printf "ERROR: An RVM installation was not found.\n" | |
fi | |
APP=/var/www/safepal | |
cd $APP | |
printf "cd $APP.\n" | |
rvm gemset use 2.4.0@safepal --create | |
git add -A | |
git stash | |
git pull origin master | |
git stash apply | |
bundle install | |
npm install | |
rails db:migrate | |
rake assets:precompile | |
whenever --update-crontab | |
sudo service nginx stop | |
sudo service cron restart | |
sudo service redis restart | |
sudo service sidekiq restart | |
sudo service nginx start | |
printf "Completed.\n" | |
sudo chmod 755 /usr/sbin/pull |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment