Make the watcher update the Haml and Sass pages when the respective branches are updated.

This commit is contained in:
Nathan Weizenbaum 2009-06-17 21:23:35 -07:00
parent 51e4994d2b
commit 00c3f79a99
3 changed files with 30 additions and 15 deletions

View File

@ -116,8 +116,8 @@ 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 extra/edge_gem_watch.rb}
task :watch_for_update do
sh %{ruby extra/update_watch.rb}
end
# ----- Documentation -----
@ -155,6 +155,18 @@ rescue LoadError
task :yardoc => :rdoc
end
task :pages do
require 'fileutils'
raise 'No ENV["PROJ"]!' unless proj = ENV["PROJ"]
sh %{git checkout #{proj}-pages}
sh %{git pull origin #{proj}-pages}
sh %{staticmatic build .}
FileUtils.mv("site", "/var/www/#{proj}-pages")
sh %{git reset --hard HEAD}
sh %{git clean -xdf}
end
# ----- Coverage -----
begin

View File

@ -1,13 +0,0 @@
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

16
extra/update_watch.rb Normal file
View File

@ -0,0 +1,16 @@
require 'rubygems'
require 'sinatra'
require 'json'
set :port, 3123
set :environment, :production
Dir.chdir(File.dirname(__FILE__) + "/..")
post "/" do
payload = JSON.parse(params["payload"])
if payload["ref"] == "refs/heads/master"
system("rake release_edge &> edge-gem-output.log")
elsif payload["ref"] =~ %r{^refs/heads/(haml|sass)-pages$}
system("rake pages PROJ=#{$1}")
end
end