Adding GitHub Pages tasks

This commit is contained in:
David Danzilio 2016-04-07 17:13:39 -04:00 committed by David Danzilio
parent b39409ae79
commit 84e6ade587
1 changed files with 33 additions and 0 deletions

View File

@ -15,4 +15,37 @@ namespace :strings do
task :serve do task :serve do
PuppetX::PuppetLabs::Strings::Util.serve PuppetX::PuppetLabs::Strings::Util.serve
end end
namespace :gh_pages do
git_uri = `git config --get remote.origin.url`.strip
desc "Checkout the gh-pages branch for doc generation."
task :checkout do
unless Dir.exist?('doc')
Dir.mkdir('doc')
Dir.chdir('doc') do
system 'git init'
system "git remote add origin #{git_uri}"
system 'git pull'
system 'git checkout -b gh-pages'
end
end
end
desc "Push new docs to GitHub."
task :push do
Dir.chdir('doc') do
system 'git add .'
system "git commit -m '[strings] Generated Documentation Update'"
system 'git push origin gh-pages -f'
end
end
desc "Run checkout, generate, and push tasks."
task :update => [
:checkout,
:'strings:generate',
:push,
]
end
end end