Skip to content

Commit

Permalink
Added endpoint for building Rails guides from HTTP hook
Browse files Browse the repository at this point in the history
  • Loading branch information
karmi committed Jan 1, 2011
1 parent 83ac15d commit 0a626fd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ source 'http://rubygems.org'

gem 'rake'
gem 'sinatra'

group :guides do
gem 'RedCloth'
gem 'i18n'
gem 'erubis'
end
11 changes: 11 additions & 0 deletions application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ class Application < Sinatra::Base
username == Config::USERNAME && password == Config::PASSWORD
end

post '/build' do
cmd = []
cmd << "cd #{Config::GUIDES}"
cmd << "rm -rf output/cz"
cmd << "git fetch origin"
cmd << "git reset origin/czech --hard"
cmd << "rake generate_guides ONLY=getting_started LANG=cz"
puts "Running command: " + cmd.join(' && ')
system cmd.join(' && ')
end

end
end

Expand Down

0 comments on commit 0a626fd

Please sign in to comment.