1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Fix up some update-watcher stuff.

This commit is contained in:
Nathan Weizenbaum 2009-07-04 16:26:25 -07:00
parent 242aee3746
commit 5709b7082a
2 changed files with 14 additions and 2 deletions

View file

@ -250,6 +250,12 @@ end
# ----- Handling Updates -----
task :handle_update do
unless ENV["REF"] =~ %r{^refs/heads/(master|(?:haml|sass)-pages)$}
puts "#{'=' * 20} Ignoring rake handle_update REF=#{ENV["REF"].inspect}"
next
end
branch = $1
puts
puts
puts '=' * 150
@ -260,11 +266,11 @@ task :handle_update do
sh %{git reset --hard origin/master}
begin
if ENV["REF"] == "refs/heads/master"
if branch == "master"
sh %{rake release_edge --trace}
sh %{rake pages --trace PROJ=haml}
sh %{rake pages --trace PROJ=sass}
elsif ENV["REF"] =~ %r{^refs/heads/(haml|sass)-pages$}
elsif branch =~ /^(haml|sass)-pages$/
sh %{rake pages --trace PROJ=#{$1}}
end
ensure
@ -272,4 +278,7 @@ task :handle_update do
sh %{git clean -xdf}
sh %{git checkout master}
end
puts 'Done running handle_update'
puts '=' * 150
end

View file

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