From 2ae9dfcecc4ad6271be1a5a83326e69c6cb1d68d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 6 Sep 2020 08:27:55 +0100 Subject: [PATCH] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 34 +++++++++++++---------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index d8422a4..db96b43 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -34,32 +34,28 @@ pipeline { buildstampprefix = doxygenmeta.buildstampinfo.buildstampprefix echo "Doyxgen imported for product: ${productname} and build stamp prefix: ${buildstampprefix}" - - pathonserver = "${ROOT_PATH_ON_SERVER}/${productname}/${buildstampprefix}" } } } - stage('Clean destination') { - steps { - script { - cleanfolders = [ - pathonserver, - ] - cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") - cleaner.clean(cleanfolders) - } - } - } - stage('Copy doxygen to server') { steps { script { doxygensource = "${DOXYGEN}/${ARTIFACT_PATH_TO_DOXYGEN_ROOT}" - echo "Copying from ${doxygensource} to ${pathonserver}" - dir(pathonserver) { - } - dir(doxygensource) { - fileOperations([fileCopyOperation(targetLocation: pathonserver)]) + pathonserver = "${ROOT_PATH_ON_SERVER.trim()}/${productname}/${buildstampprefix}" + echo "Moving from ${doxygensource} to ${pathonserver}" + if isUnix() { + sh """#!/bin/bash + rm -rfv "${pathonserver}" + if [ \$? -ne 0 ]; then exit 1; fi + + mkdir -pv "${pathonserver}" + if [ \$? -ne 0 ]; then exit 1; fi + + mv -v "${doxygensource}"/* "${pathonserver}" + if [ \$? -ne 0 ]; then exit 1; fi + + } else { + error("This job does not run on Windows at the moment") } } }