update_watch.rb 331 B

12345678910111213
  1. require 'rubygems'
  2. require 'sinatra'
  3. require 'json'
  4. set :port, 3124
  5. set :environment, :production
  6. enable :lock
  7. Dir.chdir(File.dirname(__FILE__) + "/..")
  8. post "/" do
  9. puts "Recieved payload!"
  10. puts "Rev: #{`git name-rev HEAD`.strip}"
  11. system %{rake handle_update --trace REF=#{JSON.parse(params["payload"])["ref"].inspect}}
  12. end