Skip to content

Commit 8438965

Browse files
authored
Merge pull request #540 from datastax/fix_cpp_aws
fix the missing OS_DISTRO env variable in some steps
2 parents ea002f8 + 955866f commit 8438965

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

Jenkinsfile

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!groovy
22
import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
33

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+
49
def initializeEnvironment() {
510
env.DRIVER_DISPLAY_NAME = 'Cassandra C/C++ Driver'
611
env.DRIVER_TYPE = 'CASS'
@@ -545,7 +550,10 @@ pipeline {
545550
post {
546551
success {
547552
// 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+
}
549557
}
550558
}
551559
}
@@ -555,12 +563,18 @@ pipeline {
555563
}
556564
post {
557565
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+
}
560571
}
561572
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+
}
564578
}
565579
}
566580
}
@@ -590,7 +604,10 @@ pipeline {
590604
}
591605
post {
592606
success {
593-
archiveArtifacts artifacts: "${env.OS_DISTRO}/**/*-cpp-driver*"
607+
script {
608+
def distro = get_os_distro()
609+
archiveArtifacts artifacts: "${distro}/**/*-cpp-driver*"
610+
}
594611
}
595612
}
596613
}
@@ -748,8 +765,11 @@ pipeline {
748765
}
749766
post {
750767
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+
}
753773
}
754774
}
755775
}
@@ -764,7 +784,10 @@ pipeline {
764784
junit testResults: '*integration-tests-*-results.xml', allowEmptyResults: true
765785
}
766786
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+
}
768791
}
769792
cleanup {
770793
cleanWs()

0 commit comments

Comments
 (0)