Created
September 9, 2016 12:52
-
-
Save CallumJHays/9b14827e61795a256d28ec9eb655f2ce 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
| #!/bin/bash | |
| ssh ubuntu@54.206.64.114 'bash ~/delivery-webapp/scripts/on_server.sh && exit' |
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
| #!/bin/bash | |
| # change into project dir | |
| cd ~/delivery-webapp/ | |
| # stash changes that may cause issues | |
| git stash | |
| echo 'changes stashed' | |
| # pull changes from git | |
| git pull origin master | |
| echo 'pulled updates' | |
| # install dependencies | |
| ./bin/bundle install --quiet | |
| echo 'installing bundle' | |
| # run migrations | |
| ./bin/rake db:migrate | |
| echo 'migrating database' | |
| # add default values <admin, employees, users> to database | |
| # these are found in the /db/seeds.rb file | |
| ./bin/rake db:seed | |
| echo 'seeding database' | |
| # install vendor dependencies | |
| ./bin/rake bower:install | |
| echo 'installing bower stuff' | |
| # restart the server | |
| echo 'reading the server PID' | |
| PID=$(<tmp/pids/server.pid) | |
| echo 'PID' | |
| echo "$PID" | |
| if [[ "$PID" ]] | |
| then | |
| rvmsudo kill -9 "$PID" | |
| sleep 1 | |
| fi | |
| rvmsudo ./bin/rails server -p 80 -b 0.0.0.0 > ~/server.log & | |
| exit | |
| logout | |
| exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment