From 172d97ddeb12589b6338422df4906720f88c27e4 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Fri, 5 Nov 2010 22:41:32 -0700 Subject: [PATCH] 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. --- docs/build.gradle | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/build.gradle b/docs/build.gradle index 9c3ea47505..c2152ec1b2 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -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}" } }