Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a Rake task and Sinatra script for a GitHub post-receive hook.
  • Loading branch information
nex3 committed Apr 30, 2009
1 parent c24c4ff commit 398bbe0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Rakefile
Expand Up @@ -116,6 +116,10 @@ task :release_edge do
sh %{rubyforge add_release haml haml-edge "Bleeding Edge (v#{edge_version})" pkg/haml-edge-#{edge_version}.gem}
end

task :watch_for_edge_update do
sh %{ruby edge_gem_watch.rb}
end

# ----- Documentation -----

begin
Expand Down
13 changes: 13 additions & 0 deletions extra/edge_gem_watch.rb
@@ -0,0 +1,13 @@
require 'rubygems'
require 'sinatra'
require 'json'
set :port, 3123
set :environment, :production
Dir.chdir(File.dirname(__FILE__) + "/..")

post "/" do
payload = JSON.parse(params["payload"])

break unless payload["ref"] == "refs/heads/master"
system("rake release_edge &> edge-gem-output.log")
end

0 comments on commit 398bbe0

Please sign in to comment.