Guest User

Untitled

a guest
Jan 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. exit_with_error() {
  4. echo "!!!! An error has occurred !!!!"
  5. exit 1
  6. }
  7.  
  8. # Initial directory is .git, so go to the working copy directory
  9. cd ..
  10.  
  11. export RAILS_ENV="production"
  12.  
  13. echo "************************"
  14. echo "Deploying application..."
  15. echo "************************"
  16.  
  17. # Add everything to the index and then reset hard to both sweep changed files (like cached pages)
  18. # and update the working copy.
  19. echo "------> Updating application working tree"
  20. env -i git add .
  21. env -i git reset --hard || exit_with_error
  22.  
  23. echo "------> Restarting app"
  24. mkdir -p log
  25. mkdir -p tmp
  26.  
  27. if [ -e lib/deploy_hooks/post-receive ]; then
  28. lib/deploy_hooks/post-receive
  29. fi
  30.  
  31. touch tmp/restart.txt
  32.  
  33. echo "------> Successfully deployed app"
Add Comment
Please, Sign In to add comment