Skip to content

Commit d01cb9c

Browse files
committed
ci: dynamically set GCOV_PREFIX_STRIP
1 parent 8a49ddf commit d01cb9c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Jenkinsfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,9 @@ def get_sonarqube_unresolved_issues(report_task_file){
464464
return outstandingIssues
465465
}
466466
}
467+
def calculateGCOV_PREFIX_STRIP(){
468+
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}\'')
469+
}
467470

468471
// *****************************************************************************
469472
stage('Pipeline Pre-tasks'){
@@ -553,7 +556,7 @@ pipeline {
553556
stage('Building Documentation'){
554557
environment{
555558
GCOV_PREFIX='build/temp'
556-
GCOV_PREFIX_STRIP=5
559+
GCOV_PREFIX_STRIP=calculateGCOV_PREFIX_STRIP()
557560
}
558561
steps {
559562
catchError(buildResult: 'UNSTABLE', message: 'Building Sphinx documentation has issues', stageResult: 'UNSTABLE') {
@@ -584,7 +587,7 @@ pipeline {
584587
stage('Python tests'){
585588
environment{
586589
GCOV_PREFIX='build/temp'
587-
GCOV_PREFIX_STRIP=5
590+
GCOV_PREFIX_STRIP=calculateGCOV_PREFIX_STRIP()
588591
}
589592
steps{
590593
script{

0 commit comments

Comments
 (0)