Skip to content

Commit

Permalink
Adding param to define test pipelines path
Browse files Browse the repository at this point in the history
  • Loading branch information
rsundriyal authored and micahsnyder committed May 1, 2024
1 parent 6779c5d commit 3809b2a
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ properties(
string(name: 'TESTS_FUZZ_BRANCH',
defaultValue: '1.4',
description: 'tests-fuzz-regression branch'),
string(name: 'TEST_PIPELINES_PATH',
defaultValue: 'ClamAV/test-pipelines',
description: 'test-pipelines path for clamav in Jenkins'),
string(name: 'BUILD_PIPELINE',
defaultValue: 'build-1.4',
description: 'test-pipelines branch for build acceptance'),
Expand Down Expand Up @@ -79,7 +82,7 @@ node('ubuntu-18-x64') {
def buildResult

stage('Build') {
buildResult = build(job: "test-pipelines/${params.BUILD_PIPELINE}",
buildResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.BUILD_PIPELINE}",
propagate: true,
wait: true,
parameters: [
Expand All @@ -90,7 +93,7 @@ node('ubuntu-18-x64') {
[$class: 'StringParameterValue', name: 'SHARED_LIB_BRANCH', value: "${params.SHARED_LIB_BRANCH}"]
]
)
echo "test-pipelines/${params.BUILD_PIPELINE} #${buildResult.number} succeeded."
echo "${params.TEST_PIPELINES_PATH}/${params.BUILD_PIPELINE} #${buildResult.number} succeeded."
}

stage('Test') {
Expand All @@ -101,28 +104,28 @@ node('ubuntu-18-x64') {
def exception = null
try {
stage("Regular Pipeline") {
regularResult = build(job: "test-pipelines/${params.REGULAR_PIPELINE}",
regularResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.REGULAR_PIPELINE}",
propagate: true,
wait: true,
parameters: [
[$class: 'StringParameterValue', name: 'CLAMAV_JOB_NAME', value: "${JOB_NAME}"],
[$class: 'StringParameterValue', name: 'CLAMAV_JOB_NUMBER', value: "${BUILD_NUMBER}"],
[$class: 'StringParameterValue', name: 'BUILD_JOB_NAME', value: "test-pipelines/${params.BUILD_PIPELINE}"],
[$class: 'StringParameterValue', name: 'BUILD_JOB_NAME', value: "${params.TEST_PIPELINES_PATH}/${params.BUILD_PIPELINE}"],
[$class: 'StringParameterValue', name: 'BUILD_JOB_NUMBER', value: "${buildResult.number}"],
[$class: 'StringParameterValue', name: 'TESTS_BRANCH', value: "${params.TESTS_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}"]
]
)
echo "test-pipelines/${params.REGULAR_PIPELINE} #${regularResult.number} succeeded."
echo "${params.TEST_PIPELINES_PATH}/${params.REGULAR_PIPELINE} #${regularResult.number} succeeded."
}
} catch (exc) {
echo "test-pipelines/${params.REGULAR_PIPELINE} failed."
echo "${params.TEST_PIPELINES_PATH}/${params.REGULAR_PIPELINE} failed."
exception = exc
}
stage("Custom Pipeline") {
final customResult = build(job: "test-pipelines/${params.CUSTOM_PIPELINE}",
final customResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.CUSTOM_PIPELINE}",
propagate: true,
wait: true,
parameters: [
Expand All @@ -134,7 +137,7 @@ node('ubuntu-18-x64') {
[$class: 'StringParameterValue', name: 'SHARED_LIB_BRANCH', value: "${params.SHARED_LIB_BRANCH}"]
]
)
echo "test-pipelines/${params.CUSTOM_PIPELINE} #${customResult.number} succeeded."
echo "${params.TEST_PIPELINES_PATH}/${params.CUSTOM_PIPELINE} #${customResult.number} succeeded."
}
if(exception != null) {
echo "Custom Pipeline passed, but Regular pipeline failed!"
Expand All @@ -144,7 +147,7 @@ node('ubuntu-18-x64') {

tasks["fuzz_regression"] = {
stage("Fuzz Regression") {
final fuzzResult = build(job: "test-pipelines/${params.FUZZ_PIPELINE}",
final fuzzResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.FUZZ_PIPELINE}",
propagate: true,
wait: true,
parameters: [
Expand All @@ -155,7 +158,7 @@ node('ubuntu-18-x64') {
[$class: 'StringParameterValue', name: 'VERSION', value: "${params.VERSION}"]
]
)
echo "test-pipelines/${params.FUZZ_PIPELINE} #${fuzzResult.number} succeeded."
echo "${params.TEST_PIPELINES_PATH}/${params.FUZZ_PIPELINE} #${fuzzResult.number} succeeded."
}
}

Expand Down

0 comments on commit 3809b2a

Please sign in to comment.