11#! groovy
22import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
33
4- def init_os_distro () {
5- env . OS_DISTRO = sh(label : ' Assign env.OS_DISTRO based on OS env' , script : ''' #!/bin/bash -le
4+ def get_os_distro () {
5+ return sh(label : ' Assign env.OS_DISTRO based on OS env' , script : ''' #!/bin/bash -le
66 echo ${OS_DISTRO}''' , returnStdout : true ). trim()
77}
88
@@ -550,8 +550,8 @@ pipeline {
550550 post {
551551 success {
552552 // Allow empty results for 'osx/high-sierra' which doesn't produce packages
553- init_os_distro ()
554- archiveArtifacts artifacts : " ${ env.OS_DISTRO } /**/libuv*" , allowEmptyArchive : true
553+ def distro = get_os_distro ()
554+ archiveArtifacts artifacts : " ${ distro } /**/libuv*" , allowEmptyArchive : true
555555 }
556556 }
557557 }
@@ -561,14 +561,14 @@ pipeline {
561561 }
562562 post {
563563 success {
564- init_os_distro ()
565- archiveArtifacts artifacts : " ${ env.OS_DISTRO } /**/cassandra-*-tests"
566- archiveArtifacts artifacts : " ${ env.OS_DISTRO } /**/dse-*-tests" , allowEmptyArchive : true
564+ def distro = get_os_distro ()
565+ archiveArtifacts artifacts : " ${ distro } /**/cassandra-*-tests"
566+ archiveArtifacts artifacts : " ${ distro } /**/dse-*-tests" , allowEmptyArchive : true
567567 }
568568 failure {
569- init_os_distro ()
570- archiveArtifacts artifacts : " ${ env.OS_DISTRO } /**/CMakeOutput.log"
571- archiveArtifacts artifacts : " ${ env.OS_DISTRO } /**/CMakeError.log"
569+ def distro = get_os_distro ()
570+ archiveArtifacts artifacts : " ${ distro } /**/CMakeOutput.log"
571+ archiveArtifacts artifacts : " ${ distro } /**/CMakeError.log"
572572 }
573573 }
574574 }
@@ -598,8 +598,8 @@ pipeline {
598598 }
599599 post {
600600 success {
601- init_os_distro ()
602- archiveArtifacts artifacts : " ${ env.OS_DISTRO } /**/*-cpp-driver*"
601+ def distro = get_os_distro ()
602+ archiveArtifacts artifacts : " ${ distro } /**/*-cpp-driver*"
603603 }
604604 }
605605 }
@@ -757,9 +757,9 @@ pipeline {
757757 }
758758 post {
759759 failure {
760- init_os_distro ()
761- archiveArtifacts artifacts : " ${ env.OS_DISTRO } /**/CMakeOutput.log"
762- archiveArtifacts artifacts : " ${ env.OS_DISTRO } /**/CMakeError.log"
760+ def distro = get_os_distro ()
761+ archiveArtifacts artifacts : " ${ distro } /**/CMakeOutput.log"
762+ archiveArtifacts artifacts : " ${ distro } /**/CMakeError.log"
763763 }
764764 }
765765 }
@@ -774,8 +774,8 @@ pipeline {
774774 junit testResults : ' *integration-tests-*-results.xml' , allowEmptyResults : true
775775 }
776776 failure {
777- init_os_distro ()
778- archiveArtifacts artifacts : " ${ env.OS_DISTRO } /**/*-integration-tests-driver-logs.tgz"
777+ def distro = get_os_distro ()
778+ archiveArtifacts artifacts : " ${ distro } /**/*-integration-tests-driver-logs.tgz"
779779 }
780780 cleanup {
781781 cleanWs()
0 commit comments