Last active
June 8, 2022 17:41
-
-
Save danchoi/9717390 to your computer and use it in GitHub Desktop.
Revisions
-
Daniel Choi revised this gist
Mar 23, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,8 @@ # Set the deploy_dir variable to the path on the production server to # deployment directory. The script assumes the deployment directory is a git # clone of the codebase from an upstream git repo. This script also assumes # you are using Passenger. deploy_dir=~/current # deploy dir -
Daniel Choi revised this gist
Mar 23, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,7 @@ else fi # Uncomment if using ThinkingSphinx # RAILS_ENV=production bundle exec rake ts:rebuild # Restart if any new Rails code -
Daniel Choi revised this gist
Mar 23, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ deploy_dir=~/current # deploy dir echo "=======> Deploying to $deploy_dir <========" cd $deploy_dir && git stash && git pull # Run migrations if any are pulled down if find db/migrate -type f -mmin -3 | grep '.*' -
Daniel Choi created this gist
Mar 23, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ #!/bin/bash # deploy.sh # Put this script on your production server and make it executable with chmod # +x. # Set the deploy_dir variable to the path on the production server to # deployment directory. The script assumes the deployment directory is a git # clone of the codebase from an upstream git repo. deploy_dir=~/current # deploy dir # You then can run deploy.sh remotely with ssh: # # ssh user@deployserver "~/deploy.sh" echo "=======> Deploying to $deploy_dir <========" cd /$deploy_dir && git stash && git pull # Run migrations if any are pulled down if find db/migrate -type f -mmin -3 | grep '.*' then echo New migrations found RAILS_ENV=production bundle exec rake db:migrate else echo No new migrations fi # Uncomment if using ThinkingSphinx # RAILS_ENV=$deploy_dir bundle exec rake ts:rebuild # Restart if any new Rails code if find app config lib db/migrate -type f -mmin -3 | grep '.*' then echo Restarting Rails touch tmp/restart.txt else echo No need to restart fi