Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created August 24, 2009 02:08
Show Gist options
  • Save defunkt/173604 to your computer and use it in GitHub Desktop.
Save defunkt/173604 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'deployr'
require 'thin'
Rack::Handler::Thin.run Deployr.new, :Port => 4000
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment