Don't publish the feed when Jenkins regenerates the documentation

This commit is contained in:
Blake Watters
2013-02-07 12:04:28 -05:00
parent 1add8f5410
commit 5f918a8f81
2 changed files with 5 additions and 4 deletions

View File

@@ -125,8 +125,8 @@ namespace :docs do
end
desc "Build and publish the documentation set to the remote server (using rsync over SSH)"
task :publish, :version, :destination do |t, args|
args.with_defaults(:version => File.read("VERSION").chomp, :destination => "restkit.org:/var/www/public/restkit.org/public/api/")
task :publish, :version, :destination, :publish_feed do |t, args|
args.with_defaults(:version => File.read("VERSION").chomp, :destination => "restkit.org:/var/www/public/restkit.org/public/api/", :publish_feed => 'true')
version = args[:version]
destination = args[:destination]
puts "Generating RestKit docset for version #{version}..."
@@ -141,7 +141,8 @@ namespace :docs do
command = "rsync -rvpPe ssh --delete Docs/API/html/ #{versioned_destination}"
run(command)
if $?.exitstatus == 0
should_publish_feed = %{yes true 1}.include?(args[:publish_feed].downcase)
if $?.exitstatus == 0 && should_publish_feed
command = "rsync -rvpPe ssh Docs/API/publish/* #{destination}"
run(command)
end

View File

@@ -22,6 +22,6 @@ if [ -n $DOCS_DESTINATION ]; then
VERSION=`echo $GIT_BRANCH|sed -e 's/origin\///'`
if [ -n $VERSION ]; then
echo "Building documentation for branch $VERSION and publishing to '$DOCS_DESTINATION'"
rake docs:publish[$VERSION,$DOCS_DESTINATION]
rake docs:publish[$VERSION,$DOCS_DESTINATION,false]
fi
fi