Update symlinks during :docs:uploadArchives

Previous to this change, symlinks at
http://static.springsource.org/spring-integration/docs had to be
maintained by hand.  The build now automatically updates:

* 'Wildcard' symlinks (e.g.: 2.0.x -> 2.0.0.RC1) if the release type
 is anything other than SNAPSHOT.

* 'Latest GA' symlink (e.g.: latest-ga -> 1.0.3.RELEASE) if the release
 type is RELEASE.

Also, deletion of the docs zip archive is now consolidated into the
same 'sshexec' command as the unzipping itself.  Unzipping is now
done with -q (quiet) to cut down on output noise.
This commit is contained in:
Chris Beams
2010-11-05 22:41:32 -07:00
parent 53b132b7b5
commit 172d97ddeb

View File

@@ -225,13 +225,20 @@ uploadArchives {
classpath: configurations.scpAntTask.asPath)
// copy the archive, unpack it, then delete it
def unpackCommand = "cd ${remoteDocsDir} && unzip -K -o ${archive.archiveName}"
def deleteCommand = "rm ${remoteDocsDir}/${archive.archiveName}"
def unpackCommand = "cd ${remoteDocsDir} && rm -rf ${version} && unzip -qKo ${archive.archiveName} && rm ${archive.archiveName}"
def wildcardSymlinkCommand = "cd ${remoteDocsDir} && rm -f ${version.wildcardValue} && ln -s ${version} ${version.wildcardValue}"
def latestGASymlinkCommand = "cd ${remoteDocsDir} && rm -f latest-ga && ln -s ${version} latest-ga"
println "sshexec ${unpackCommand}"
println "Unpacking docs archive: (${unpackCommand})"
sshexec(host: sshHost, username: sshUsername, keyfile: sshPrivateKey, command: unpackCommand)
println "sshexec ${deleteCommand}"
sshexec(host: sshHost, username: sshUsername, keyfile: sshPrivateKey, command: deleteCommand)
if (version.releaseType != 'SNAPSHOT') {
println "Creating wildcard symlink: (${wildcardSymlinkCommand})"
sshexec(host: sshHost, username: sshUsername, keyfile: sshPrivateKey, command: wildcardSymlinkCommand)
}
if (version.releaseType == 'RELEASE') {
println "Creating latest-ga symlink: (${latestGASymlinkCommand})"
sshexec(host: sshHost, username: sshUsername, keyfile: sshPrivateKey, command: latestGASymlinkCommand)
}
println "UPLOAD SUCCESSFUL - validate by visiting ${docUrl}"
}
}