mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-25 21:35:36 +08:00
Don't publish the feed when Jenkins regenerates the documentation
This commit is contained in:
7
Rakefile
7
Rakefile
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user