Skip to content

Commit 1b86e0c

Browse files
Merge pull request #216 from UIUCLibrary/ci
ci: dynamically set GCOV_PREFIX_STRIP
2 parents 02081ab + fb8ac33 commit 1b86e0c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

vars/runJenkinsPipeline.groovy

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ def get_sonarqube_unresolved_issues(report_task_file){
389389
}
390390
}
391391

392+
def calculateGCOV_PREFIX_STRIP(){
393+
return sh(returnStdout: true, label: 'configuring GCOV_PREFIX_STRIP', script:'echo "$PWD" | awk -F/ \'{c=0; for(i=1;i<=NF;i++) if($i!="") c++; print c+2}\'')
394+
}
395+
392396

393397
def startup(sonarCredentialId, defaultParameterValues){
394398
parallel(
@@ -543,7 +547,7 @@ def call(){
543547
stage('Building Documentation'){
544548
environment{
545549
GCOV_PREFIX='build/temp'
546-
GCOV_PREFIX_STRIP=5
550+
GCOV_PREFIX_STRIP=calculateGCOV_PREFIX_STRIP()
547551
}
548552
steps{
549553
timeout(3){
@@ -580,7 +584,7 @@ def call(){
580584
stage('Python Tests'){
581585
environment{
582586
GCOV_PREFIX='build/temp'
583-
GCOV_PREFIX_STRIP=5
587+
GCOV_PREFIX_STRIP=calculateGCOV_PREFIX_STRIP()
584588
}
585589
steps{
586590
script{

0 commit comments

Comments
 (0)