Skip to content

Commit

Permalink
new rake publish task to update the docs in gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydmiller committed Jan 4, 2017
1 parent ef16004 commit 7c95659
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,5 @@ project.lock.json
src/DinnerParty/public/*.js
src/DinnerParty/public/*.css
src/DinnerParty/public/*.map

doc-target
37 changes: 33 additions & 4 deletions rakefile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,39 @@
sh "#{storyteller_cmd} open src/Marten.Testing"
end

desc "Launches the documentation project in editable mode"
task :docs => [:restore] do
storyteller_cmd = storyteller_path()
sh "#{storyteller_cmd} doc-run -v #{BUILD_VERSION}"
"Launches the documentation project in editable mode"
task :docs do
sh "dotnet restore"
sh "dotnet stdocs run -v #{BUILD_VERSION}"
end

"Exports the documentation to structuremap.github.io - requires Git access to that repo though!"
task :publish do
FileUtils.remove_dir('doc-target') if Dir.exists?('doc-target')

if !Dir.exists? 'doc-target'
Dir.mkdir 'doc-target'
sh "git clone -b gh-pages https://github.com/jasperfx/marten.git doc-target"
else
Dir.chdir "doc-target" do
sh "git checkout --force"
sh "git clean -xfd"
sh "git pull origin master"
end
end

sh "dotnet restore"
sh "dotnet stdocs export doc-target ProjectWebsite --version #{BUILD_VERSION} --project marten"

Dir.chdir "doc-target" do
sh "git add --all"
sh "git commit -a -m \"Documentation Update for #{BUILD_VERSION}\" --allow-empty"
sh "git push origin gh-pages"
end




end

desc 'Restores nuget packages'
Expand Down

0 comments on commit 7c95659

Please sign in to comment.