Jenkinsfile
fafb2898
 properties(
     [
68ffcc11
         disableConcurrentBuilds(),
fafb2898
         parameters(
             [
fff06e47
                 string(name: 'CLAMAV_BRANCH',
                        defaultValue: "${env.BRANCH_NAME}",
                        description: 'clamav-devel branch'),
                 string(name: 'VERSION',
bb84d9e1
                        defaultValue: '0.103.2',
fff06e47
                        description: 'ClamAV version string'),
                 string(name: 'BUILD_BRANCH',
d4a9a760
                        defaultValue: 'build-0.103',
2f74b38c
                        description: 'test-pipelines branch for build acceptance'),
                 string(name: 'FRAMEWORK_BRANCH',
d8ae44e3
                        defaultValue: '0.103',
2f74b38c
                        description: 'test-framework branch'),
fff06e47
                 string(name: 'TEST_BRANCH',
d8ae44e3
                        defaultValue: '0.103',
fff06e47
                        description: 'tests branch'),
2f74b38c
                 string(name: 'TEST_CUSTOM_BRANCH',
d8ae44e3
                        defaultValue: '0.103',
2f74b38c
                        description: 'tests-custom branch'),
fff06e47
                 string(name: 'REGULAR_PIPELINE',
2f74b38c
                        defaultValue: 'regular-0.103',
fff06e47
                        description: 'test-pipelines branch for regular tests.'),
                 string(name: 'CUSTOM_PIPELINE',
2f74b38c
                        defaultValue: 'custom-0.103',
fff06e47
                        description: 'test-pipelines branch for custom tests'),
                 string(name: 'FUZZ_PIPELINE',
2f74b38c
                        defaultValue: 'fuzz-regression-0.103',
fff06e47
                        description: 'test-pipelines branch for fuzz regression tests'),
                 string(name: 'FUZZ_BRANCH',
                        defaultValue: 'master',
                        description: 'private-fuzz-corpus branch'),
                 string(name: 'FUZZ_TEST_BRANCH',
d8ae44e3
                        defaultValue: '0.103',
2f74b38c
                        description: 'tests-fuzz-regression branch'),
                 string(name: 'SHARED_LIB_BRANCH',
3b92d019
                        defaultValue: '0.103',
2f74b38c
                        description: 'tests-jenkins-shared-libraries branch')
fafb2898
             ]
         )
     ]
 )
 
fff06e47
 def buildResult
 
fafb2898
 node('master') {
fff06e47
     stage('Build') {
2f74b38c
         buildResult = build(job: "test-pipelines/${params.BUILD_BRANCH}",
fff06e47
             propagate: true,
             wait: true,
             parameters: [
                 [$class: 'StringParameterValue', name: 'TARGET_BRANCH', value: "${params.CLAMAV_BRANCH}"],
2f74b38c
                 [$class: 'StringParameterValue', name: 'FRAMEWORK_BRANCH', value: "${params.FRAMEWORK_BRANCH}"],
                 [$class: 'StringParameterValue', name: 'VERSION', value: "${params.VERSION}"],
                 [$class: 'StringParameterValue', name: 'SHARED_LIB_BRANCH', value: "${params.SHARED_LIB_BRANCH}"]
fff06e47
             ]
         )
2f74b38c
         echo "test-pipelines/${params.BUILD_BRANCH} #${buildResult.number} succeeded."
fff06e47
     }
 
     stage('Test') {
         def tasks = [:]
 
         tasks["regular_and_custom"] = {
             def regularResult
             def exception = null
             try {
                 stage("Regular Pipeline") {
                     regularResult = build(job: "test-pipelines/${params.REGULAR_PIPELINE}",
                         propagate: true,
                         wait: true,
                         parameters: [
2f74b38c
                             [$class: 'StringParameterValue', name: 'BUILD_JOB_NAME', value: "test-pipelines/${params.BUILD_BRANCH}"],
fff06e47
                             [$class: 'StringParameterValue', name: 'BUILD_JOB_NUMBER', value: "${buildResult.number}"],
                             [$class: 'StringParameterValue', name: 'TEST_BRANCH', value: "${params.TEST_BRANCH}"],
2f74b38c
                             [$class: 'StringParameterValue', name: 'FRAMEWORK_BRANCH', value: "${params.FRAMEWORK_BRANCH}"],
                             [$class: 'StringParameterValue', name: 'VERSION', value: "${params.VERSION}"],
45ebd3de
                             [$class: 'StringParameterValue', name: 'SHARED_LIB_BRANCH', value: "${params.SHARED_LIB_BRANCH}"],
                             [$class: 'StringParameterValue', name: 'CLAMAV_BRANCH', value: "${params.CLAMAV_BRANCH}"]
fff06e47
                         ]
                     )
                     echo "test-pipelines/${params.REGULAR_PIPELINE} #${regularResult.number} succeeded."
                 }
             } catch (exc) {
2f74b38c
                 echo "test-pipelines/${params.REGULAR_PIPELINE} failed."
fff06e47
                 exception = exc
             }
             stage("Custom Pipeline") {
                 final customResult = build(job: "test-pipelines/${params.CUSTOM_PIPELINE}",
                     propagate: true,
                     wait: true,
                     parameters: [
2f74b38c
                         [$class: 'StringParameterValue', name: 'BUILD_JOB_NAME', value: "test-pipelines/${params.BUILD_BRANCH}"],
fff06e47
                         [$class: 'StringParameterValue', name: 'BUILD_JOB_NUMBER', value: "${buildResult.number}"],
2f74b38c
                         [$class: 'StringParameterValue', name: 'TEST_BRANCH', value: "${params.TEST_CUSTOM_BRANCH}"],
                         [$class: 'StringParameterValue', name: 'FRAMEWORK_BRANCH', value: "${params.FRAMEWORK_BRANCH}"],
                         [$class: 'StringParameterValue', name: 'VERSION', value: "${params.VERSION}"],
45ebd3de
                         [$class: 'StringParameterValue', name: 'SHARED_LIB_BRANCH', value: "${params.SHARED_LIB_BRANCH}"],
                         [$class: 'StringParameterValue', name: 'CLAMAV_BRANCH', value: "${params.CLAMAV_BRANCH}"]
fff06e47
                     ]
                 )
                 echo "test-pipelines/${params.CUSTOM_PIPELINE} #${customResult.number} succeeded."
             }
             if(exception != null) {
                 echo "Custom Pipeline passed, but Regular pipeline failed!"
                 throw exception
             }
         }
 
         tasks["fuzz_regression"] = {
             stage("Fuzz Regression") {
                 final fuzzResult = build(job: "test-pipelines/${params.FUZZ_PIPELINE}",
                     propagate: true,
                     wait: true,
                     parameters: [
2f74b38c
                         [$class: 'StringParameterValue', name: 'BUILD_JOB_NAME', value: "test-pipelines/${params.BUILD_BRANCH}"],
fff06e47
                         [$class: 'StringParameterValue', name: 'BUILD_JOB_NUMBER', value: "${buildResult.number}"],
                         [$class: 'StringParameterValue', name: 'FUZZ_TEST_BRANCH', value: "${params.FUZZ_TEST_BRANCH}"],
                         [$class: 'StringParameterValue', name: 'FUZZ_BRANCH', value: "${params.FUZZ_BRANCH}"],
                         [$class: 'StringParameterValue', name: 'VERSION', value: "${params.VERSION}"],
45ebd3de
                         [$class: 'StringParameterValue', name: 'CLAMAV_BRANCH', value: "${params.CLAMAV_BRANCH}"]
fff06e47
                     ]
                 )
                 echo "test-pipelines/${params.FUZZ_PIPELINE} #${fuzzResult.number} succeeded."
             }
         }
 
         tasks["appcheck"] = {
             stage("AppCheck") {
                 final appcheckResult = build(job: "test-pipelines/appcheck",
                     propagate: true,
                     wait: true,
                     parameters: [
2f74b38c
                         [$class: 'StringParameterValue', name: 'BUILD_JOB_NAME', value: "test-pipelines/${params.BUILD_BRANCH}"],
fff06e47
                         [$class: 'StringParameterValue', name: 'BUILD_JOB_NUMBER', value: "${buildResult.number}"],
45ebd3de
                         [$class: 'StringParameterValue', name: 'VERSION', value: "${params.VERSION}"],
                         [$class: 'StringParameterValue', name: 'CLAMAV_BRANCH', value: "${params.CLAMAV_BRANCH}"]
fff06e47
                     ]
                 )
                 echo "test-pipelines/appcheck #${appcheckResult.number} succeeded."
             }
         }
 
         parallel tasks
     }
fafb2898
 }