Created
June 17, 2010 13:21
-
-
Save karmi/442106 to your computer and use it in GitHub Desktop.
Revisions
-
karmi revised this gist
Oct 24, 2010 . 1 changed file with 3 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 @@ -5,14 +5,16 @@ # INSTALL # # $ curl http://gist.github.com/442106.txt -o post-receive # $ mv post-receive path/to/to/your/repo.git/hooks/post-receive # $ chmod +x post-receive INPUT = STDIN.read.strip # puts INPUT.inspect # DEBUG # === CONFIGURE THE SCRIPT HERE ================= deploy_branch = 'deploy' application_path = '/www/data/applications/myapp' # =============================================== old_revision, new_revision, -
karmi revised this gist
Oct 24, 2010 . 1 changed file with 4 additions and 5 deletions.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 @@ -23,12 +23,11 @@ DEPLOY_COMMAND =<<-END ( unset GIT_DIR \ && \ cd #{application_path} \ && \ git fetch --quiet \ && \ git reset --hard -q origin/#{deploy_branch} ) END -
karmi revised this gist
Oct 24, 2010 . 1 changed file with 2 additions and 0 deletions.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 @@ -22,6 +22,8 @@ DEPLOY_COMMAND =<<-END ( unset GIT_DIR \ && cd #{application_path} \ && \ git \ -
karmi revised this gist
Jun 17, 2010 . 1 changed file with 45 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 @@ -1 +1,45 @@ #!/usr/bin/env ruby # Example script to deploy a Rails application via Git post-receive hook # # INSTALL # # $ curl http://gist.github.com/442106.txt -o post-receive # $ mv post-receive path/to/to/your/repo/.../hooks/post-receive # $ chmod +x post-receive INPUT = STDIN.read.strip # puts INPUT.inspect # DEBUG deploy_branch = 'deploy' application_path = '/www/data/applications/myapp' old_revision, new_revision, branch = INPUT.split(' ') if branch =~ Regexp.new(deploy_branch) DEPLOY_COMMAND =<<-END ( cd #{application_path} \ && \ git \ fetch --quiet \ && \ git reset --hard -q origin/#{deploy_branch} ) END RESTART_COMMAND =<<-END ( touch #{application_path}/tmp/restart.txt ) END puts "Updating application code..." system DEPLOY_COMMAND puts "Restarting application..." system RESTART_COMMAND end -
karmi created this gist
Jun 17, 2010 .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 @@ # Example script to deploy a Rails application via Git post-receive hook