fafb2898 |
properties(
[ |
68ffcc11 |
disableConcurrentBuilds(), |
fafb2898 |
parameters(
[ |
fff06e47 |
string(name: 'CLAMAV_BRANCH',
defaultValue: "${env.BRANCH_NAME}",
description: 'clamav-devel branch'),
string(name: 'VERSION', |
2c9f634a |
defaultValue: '0.102.4', |
fff06e47 |
description: 'ClamAV version string'),
string(name: 'BUILD_BRANCH',
defaultValue: 'build-0.102', |
5f6831e9 |
description: 'test-pipelines branch for build acceptance'),
string(name: 'FRAMEWORK_BRANCH',
defaultValue: 'dev/0.102',
description: 'test-framework branch'), |
fff06e47 |
string(name: 'TEST_BRANCH',
defaultValue: 'dev/0.102',
description: 'tests branch'), |
5f6831e9 |
string(name: 'TEST_CUSTOM_BRANCH',
defaultValue: 'dev/0.102',
description: 'tests-custom branch'), |
fff06e47 |
string(name: 'REGULAR_PIPELINE', |
5f6831e9 |
defaultValue: 'regular-0.102', |
fff06e47 |
description: 'test-pipelines branch for regular tests.'),
string(name: 'CUSTOM_PIPELINE', |
5f6831e9 |
defaultValue: 'custom-0.102', |
fff06e47 |
description: 'test-pipelines branch for custom tests'),
string(name: 'FUZZ_PIPELINE', |
5f6831e9 |
defaultValue: 'fuzz-regression-0.102', |
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',
defaultValue: 'dev/0.102', |
5f6831e9 |
description: 'tests-fuzz-regression branch'),
string(name: 'SHARED_LIB_BRANCH',
defaultValue: 'master',
description: 'tests-jenkins-shared-libraries branch') |
fafb2898 |
]
)
]
)
|
fff06e47 |
def buildResult
|
fafb2898 |
node('master') { |
fff06e47 |
stage('Build') { |
5f6831e9 |
buildResult = build(job: "test-pipelines/${params.BUILD_BRANCH}", |
fff06e47 |
propagate: true,
wait: true,
parameters: [
[$class: 'StringParameterValue', name: 'TARGET_BRANCH', value: "${params.CLAMAV_BRANCH}"], |
5f6831e9 |
[$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 |
]
) |
5f6831e9 |
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: [ |
5f6831e9 |
[$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}"], |
5f6831e9 |
[$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 |
]
)
echo "test-pipelines/${params.REGULAR_PIPELINE} #${regularResult.number} succeeded."
}
} catch (exc) { |
5f6831e9 |
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: [ |
5f6831e9 |
[$class: 'StringParameterValue', name: 'BUILD_JOB_NAME', value: "test-pipelines/${params.BUILD_BRANCH}"], |
fff06e47 |
[$class: 'StringParameterValue', name: 'BUILD_JOB_NUMBER', value: "${buildResult.number}"], |
5f6831e9 |
[$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}"],
[$class: 'StringParameterValue', name: 'SHARED_LIB_BRANCH', value: "${params.SHARED_LIB_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: [ |
5f6831e9 |
[$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}"],
]
)
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: [ |
5f6831e9 |
[$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: 'VERSION', value: "${params.VERSION}"]
]
)
echo "test-pipelines/appcheck #${appcheckResult.number} succeeded."
}
}
parallel tasks
} |
fafb2898 |
} |