We wanted a really, really simple way to deploy Hurl during the 2009 Rails Rumble.
Created
August 24, 2009 02:08
-
-
Save defunkt/173604 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
require 'rubygems' | |
require 'deployr' | |
require 'thin' | |
Rack::Handler::Thin.run Deployr.new, :Port => 4000 |
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
require 'sinatra/base' | |
class Deployr < Sinatra::Base | |
get '/' do | |
update_hurl | |
"ok" | |
end | |
def update_hurl | |
return if @running | |
@running = true | |
Thread.new do | |
system "cd /www/hurl/current && git pull origin master && touch tmp/restart.txt" | |
@running = false | |
end | |
end | |
end |
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
task :default => :deploy | |
desc "Sync changes and deploy the app!" | |
task :deploy do | |
`git pull origin master && git push origin master` | |
`curl -s http://hurl.r09.railsrumble.com:4000/ &> /dev/null` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment