Skip to content

Instantly share code, notes, and snippets.

@fairchild
Created September 26, 2010 00:13
Show Gist options
  • Save fairchild/597442 to your computer and use it in GitHub Desktop.
Save fairchild/597442 to your computer and use it in GitHub Desktop.
git push = deploy
require 'rubygems'
require 'sinatra'
require 'yajl/json_gem'
post '/' do
@push = Yajl::Parser.new(:symbolize_keys => true).parse(params[:payload])
appdir="/home/blackflag/app"
@output= Kernel.system("cd #{appdir}/shared/cached-copy && git pull origin master && cap deploy")
puts "\n output = #{@output} \n"
puts "I got some JSON: #{@push.inspect}"
'ok'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment