1
1
#! groovy
2
2
import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
3
3
4
+ def get_os_distro () {
5
+ return sh(label : ' Assign env.OS_DISTRO based on OS env' , script : ''' #!/bin/bash -le
6
+ echo ${OS_DISTRO}''' , returnStdout : true ). trim()
7
+ }
8
+
4
9
def initializeEnvironment () {
5
10
env. DRIVER_DISPLAY_NAME = ' Cassandra C/C++ Driver'
6
11
env. DRIVER_TYPE = ' CASS'
@@ -545,7 +550,10 @@ pipeline {
545
550
post {
546
551
success {
547
552
// Allow empty results for 'osx/high-sierra' which doesn't produce packages
548
- archiveArtifacts artifacts : " ${ env.OS_DISTRO} /**/libuv*" , allowEmptyArchive : true
553
+ script {
554
+ def distro = get_os_distro()
555
+ archiveArtifacts artifacts : " ${ distro} /**/libuv*" , allowEmptyArchive : true
556
+ }
549
557
}
550
558
}
551
559
}
@@ -555,12 +563,18 @@ pipeline {
555
563
}
556
564
post {
557
565
success {
558
- archiveArtifacts artifacts : " ${ env.OS_DISTRO} /**/cassandra-*-tests"
559
- archiveArtifacts artifacts : " ${ env.OS_DISTRO} /**/dse-*-tests" , allowEmptyArchive : true
566
+ script {
567
+ def distro = get_os_distro()
568
+ archiveArtifacts artifacts : " ${ distro} /**/cassandra-*-tests"
569
+ archiveArtifacts artifacts : " ${ distro} /**/dse-*-tests" , allowEmptyArchive : true
570
+ }
560
571
}
561
572
failure {
562
- archiveArtifacts artifacts : " ${ env.OS_DISTRO} /**/CMakeOutput.log"
563
- archiveArtifacts artifacts : " ${ env.OS_DISTRO} /**/CMakeError.log"
573
+ script {
574
+ def distro = get_os_distro()
575
+ archiveArtifacts artifacts : " ${ distro} /**/CMakeOutput.log"
576
+ archiveArtifacts artifacts : " ${ distro} /**/CMakeError.log"
577
+ }
564
578
}
565
579
}
566
580
}
@@ -590,7 +604,10 @@ pipeline {
590
604
}
591
605
post {
592
606
success {
593
- archiveArtifacts artifacts : " ${ env.OS_DISTRO} /**/*-cpp-driver*"
607
+ script {
608
+ def distro = get_os_distro()
609
+ archiveArtifacts artifacts : " ${ distro} /**/*-cpp-driver*"
610
+ }
594
611
}
595
612
}
596
613
}
@@ -748,8 +765,11 @@ pipeline {
748
765
}
749
766
post {
750
767
failure {
751
- archiveArtifacts artifacts : " ${ env.OS_DISTRO} /**/CMakeOutput.log"
752
- archiveArtifacts artifacts : " ${ env.OS_DISTRO} /**/CMakeError.log"
768
+ script {
769
+ def distro = get_os_distro()
770
+ archiveArtifacts artifacts : " ${ distro} /**/CMakeOutput.log"
771
+ archiveArtifacts artifacts : " ${ distro} /**/CMakeError.log"
772
+ }
753
773
}
754
774
}
755
775
}
@@ -764,7 +784,10 @@ pipeline {
764
784
junit testResults : ' *integration-tests-*-results.xml' , allowEmptyResults : true
765
785
}
766
786
failure {
767
- archiveArtifacts artifacts : " ${ env.OS_DISTRO} /**/*-integration-tests-driver-logs.tgz"
787
+ script {
788
+ def distro = get_os_distro()
789
+ archiveArtifacts artifacts : " ${ distro} /**/*-integration-tests-driver-logs.tgz"
790
+ }
768
791
}
769
792
cleanup {
770
793
cleanWs()
0 commit comments