diff --git a/Gemfile b/Gemfile index ee84871..dd7d272 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,9 @@ source 'http://rubygems.org' gem 'rake' gem 'sinatra' + +group :guides do + gem 'RedCloth' + gem 'i18n' + gem 'erubis' +end diff --git a/application.rb b/application.rb index 21ee786..285ae30 100644 --- a/application.rb +++ b/application.rb @@ -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