mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Make the watcher update the Haml and Sass pages when the respective branches are updated.
This commit is contained in:
parent
51e4994d2b
commit
00c3f79a99
3 changed files with 30 additions and 15 deletions
16
Rakefile
16
Rakefile
|
@ -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}
|
sh %{rubyforge add_release haml haml-edge "Bleeding Edge (v#{edge_version})" pkg/haml-edge-#{edge_version}.gem}
|
||||||
end
|
end
|
||||||
|
|
||||||
task :watch_for_edge_update do
|
task :watch_for_update do
|
||||||
sh %{ruby extra/edge_gem_watch.rb}
|
sh %{ruby extra/update_watch.rb}
|
||||||
end
|
end
|
||||||
|
|
||||||
# ----- Documentation -----
|
# ----- Documentation -----
|
||||||
|
@ -155,6 +155,18 @@ rescue LoadError
|
||||||
task :yardoc => :rdoc
|
task :yardoc => :rdoc
|
||||||
end
|
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 -----
|
# ----- Coverage -----
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -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
16
extra/update_watch.rb
Normal 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
|
Loading…
Reference in a new issue