From 654c5dea77d37366cc2d2810dafde5099de83c09 Mon Sep 17 00:00:00 2001 From: rsundriyal Date: Fri, 23 Aug 2024 16:05:24 -0400 Subject: [PATCH 1/5] - Adding GitGuardian as a stage - Changing Jenkinsfile from scripted to declarative --- Jenkinsfile | 276 ++++++++++++++++++++++++++++------------------------ 1 file changed, 149 insertions(+), 127 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 58f2857f87..38892aa5a0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -56,159 +56,181 @@ properties( ] ) -node('default') { - stage('Generate Tarball') { - cleanWs() +pipeline { - checkout scm - - dir(path: 'clamav_documentation') { - git(url: 'https://github.com/Cisco-Talos/clamav-documentation.git', branch: "gh-pages") - } - - dir(path: 'docs/html') { - sh '''# Move the clamav-documentation here. - cp -r ../../clamav_documentation/* . - # Clean-up - rm -rf ../../clamav_documentation - rm -rf .git .nojekyll CNAME Placeholder || true - ''' - } + agent { + label "default" + } - dir(path: 'build') { - sh """# CPack - cmake .. -D VENDOR_DEPENDENCIES=ON \ - -D JSONC_INCLUDE_DIR="$HOME/.mussels/install/host-static/include/json-c" \ - -D JSONC_LIBRARY="$HOME/.mussels/install/host-static/lib/libjson-c.a" \ - -D ENABLE_JSON_SHARED=OFF \ - -D BZIP2_INCLUDE_DIR="$HOME/.mussels/install/host-static/include" \ - -D BZIP2_LIBRARY_RELEASE="$HOME/bzip2-1.0.8-install/lib/libbz2.a" \ - -D OPENSSL_ROOT_DIR="$HOME/.mussels/install/host-static" \ - -D OPENSSL_INCLUDE_DIR="$HOME/.mussels/install/host-static/include" \ - -D OPENSSL_CRYPTO_LIBRARY="$HOME/.mussels/install/host-static/lib/libcrypto.a" \ - -D OPENSSL_SSL_LIBRARY="$HOME/.mussels/install/host-static/lib/libssl.a" \ - -D LIBXML2_INCLUDE_DIR="$HOME/.mussels/install/host-static/include/libxml2" \ - -D LIBXML2_LIBRARY="$HOME/.mussels/install/host-static/lib/libxml2.a" \ - -D PCRE2_INCLUDE_DIR="$HOME/.mussels/install/host-static/include" \ - -D PCRE2_LIBRARY="$HOME/.mussels/install/host-static/lib/libpcre2-8.a" \ - -D CURSES_INCLUDE_DIR="$HOME/.mussels/install/host-static/include" \ - -D CURSES_LIBRARY="$HOME/.mussels/install/host-static/lib/libncurses.a;$HOME/.mussels/install/host-static/lib/libtinfo.a" \ - -D ZLIB_INCLUDE_DIR="$HOME/.mussels/install/host-static/include" \ - -D ZLIB_LIBRARY="$HOME/.mussels/install/host-static/lib/libz.a" \ - -D LIBCHECK_INCLUDE_DIR="$HOME/.mussels/install/host-static/include" \ - -D LIBCHECK_LIBRARY="$HOME/.mussels/install/host-static/lib/libcheck.a" + stages { - cpack --config CPackSourceConfig.cmake """ - archiveArtifacts(artifacts: "clamav-${params.VERSION}*.tar.gz", onlyIfSuccessful: true) + stage('GitGuardian Scan') { + environment { + GITGUARDIAN_API_KEY = credentials('gitguardian-token') + GITGUARDIAN_API_URL = 'https://gitguardian.cisco.com/' + } + agent { label "docker" } + steps { + withDockerContainer(args: "-i --entrypoint=''", image: 'gitguardian/ggshield:latest') { + sh 'ggshield secret scan ci' + } + } } - cleanWs() - } + stage('Generate Tarball') { + steps { + cleanWs() - def buildResult + checkout scm - stage('Build') { - buildResult = build(job: "${params.BUILD_PIPELINES_PATH}/${params.BUILD_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: '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 "${params.BUILD_PIPELINES_PATH}/${params.BUILD_PIPELINE} #${buildResult.number} succeeded." - } + dir(path: 'clamav_documentation') { + git(url: 'https://github.com/Cisco-Talos/clamav-documentation.git', branch: "gh-pages") + } - stage('Test') { - def tasks = [:] + dir(path: 'docs/html') { + sh """# Move the clamav-documentation here. +// cp -r ../../clamav_documentation/* . + # Clean-up + rm -rf ../../clamav_documentation + rm -rf .git .nojekyll CNAME Placeholder || true + """ + } - tasks["package_regular_custom"] = { - def exception = null - try { - stage("Package") { - final regularResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_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: "${params.BUILD_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 "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_PIPELINE} #${regularResult.number} succeeded." + dir(path: 'build') { + sh """# CPack + cmake .. -D VENDOR_DEPENDENCIES=ON \ + -D JSONC_INCLUDE_DIR="$HOME/.mussels/install/host-static/include/json-c" \ + -D JSONC_LIBRARY="$HOME/.mussels/install/host-static/lib/libjson-c.a" \ + -D ENABLE_JSON_SHARED=OFF \ + -D BZIP2_INCLUDE_DIR="$HOME/.mussels/install/host-static/include" \ + -D BZIP2_LIBRARY_RELEASE="$HOME/bzip2-1.0.8-install/lib/libbz2.a" \ + -D OPENSSL_ROOT_DIR="$HOME/.mussels/install/host-static" \ + -D OPENSSL_INCLUDE_DIR="$HOME/.mussels/install/host-static/include" \ + -D OPENSSL_CRYPTO_LIBRARY="$HOME/.mussels/install/host-static/lib/libcrypto.a" \ + -D OPENSSL_SSL_LIBRARY="$HOME/.mussels/install/host-static/lib/libssl.a" \ + -D LIBXML2_INCLUDE_DIR="$HOME/.mussels/install/host-static/include/libxml2" \ + -D LIBXML2_LIBRARY="$HOME/.mussels/install/host-static/lib/libxml2.a" \ + -D PCRE2_INCLUDE_DIR="$HOME/.mussels/install/host-static/include" \ + -D PCRE2_LIBRARY="$HOME/.mussels/install/host-static/lib/libpcre2-8.a" \ + -D CURSES_INCLUDE_DIR="$HOME/.mussels/install/host-static/include" \ + -D CURSES_LIBRARY="$HOME/.mussels/install/host-static/lib/libncurses.a;$HOME/.mussels/install/host-static/lib/libtinfo.a" \ + -D ZLIB_INCLUDE_DIR="$HOME/.mussels/install/host-static/include" \ + -D ZLIB_LIBRARY="$HOME/.mussels/install/host-static/lib/libz.a" \ + -D LIBCHECK_INCLUDE_DIR="$HOME/.mussels/install/host-static/include" \ + -D LIBCHECK_LIBRARY="$HOME/.mussels/install/host-static/lib/libcheck.a" + + cpack --config CPackSourceConfig.cmake + """ + archiveArtifacts(artifacts: "clamav-${params.VERSION}*.tar.gz", onlyIfSuccessful: true) } - } catch (exc) { - echo "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_PIPELINE} failed." - exception = exc + cleanWs() } + } - try { - stage("Regular From-Source") { - final regularResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.REGULAR_PIPELINE}", + stage('Build') { + steps { + script{ + buildResult = build(job: "${params.BUILD_PIPELINES_PATH}/${params.BUILD_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: '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 "${params.TEST_PIPELINES_PATH}/${params.REGULAR_PIPELINE} #${regularResult.number} succeeded." + echo "${params.BUILD_PIPELINES_PATH}/${params.BUILD_PIPELINE} #${buildResult.number} succeeded." } - } catch (exc) { - echo "${params.TEST_PIPELINES_PATH}/${params.REGULAR_PIPELINE} failed." - exception = exc - } - - stage("Custom From-Source") { - final customResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.CUSTOM_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: 'TESTS_BRANCH', value: "${params.TESTS_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}"] - ] - ) - echo "${params.TEST_PIPELINES_PATH}/${params.CUSTOM_PIPELINE} #${customResult.number} succeeded." - } - if(exception != null) { - echo "Custom Pipeline passed, but prior pipelines failed!" - throw exception } } - tasks["fuzz_regression"] = { - stage("Fuzz Regression") { - final fuzzResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.FUZZ_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: 'TESTS_FUZZ_BRANCH', value: "${params.TESTS_FUZZ_BRANCH}"], - [$class: 'StringParameterValue', name: 'FUZZ_CORPUS_BRANCH', value: "${params.FUZZ_CORPUS_BRANCH}"], - [$class: 'StringParameterValue', name: 'VERSION', value: "${params.VERSION}"] - ] - ) - echo "${params.TEST_PIPELINES_PATH}/${params.FUZZ_PIPELINE} #${fuzzResult.number} succeeded." + stage('Tests') { + parallel { + stage('Pipeline') { + stages{ + // Regular and custom tests run sequentially on same infra + stage("Package") { + steps { + script{ + regularResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_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: '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 "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_PIPELINE} #${regularResult.number} succeeded." + } + } + } + + stage("Regular From-Source") { + steps { + script{ + 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: '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 "${params.TEST_PIPELINES_PATH}/${params.REGULAR_PIPELINE} #${regularResult.number} succeeded." + } + } + } + + stage("Custom From-Source") { + steps { + script{ + customResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.CUSTOM_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: 'TESTS_BRANCH', value: "${params.TESTS_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}"] + ] + ) + echo "${params.TEST_PIPELINES_PATH}/${params.CUSTOM_PIPELINE} #${customResult.number} succeeded." + } + } + } + } + } + stage("Fuzz Regression") { + steps { + script{ + fuzzResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.FUZZ_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: 'TESTS_FUZZ_BRANCH', value: "${params.TESTS_FUZZ_BRANCH}"], + [$class: 'StringParameterValue', name: 'FUZZ_CORPUS_BRANCH', value: "${params.FUZZ_CORPUS_BRANCH}"], + [$class: 'StringParameterValue', name: 'VERSION', value: "${params.VERSION}"] + ] + ) + echo "${params.TEST_PIPELINES_PATH}/${params.FUZZ_PIPELINE} #${fuzzResult.number} succeeded." + } + } + } } } - - parallel tasks } -} +} \ No newline at end of file From 77bee3f531241f26fd8ded9e837586742f7971f7 Mon Sep 17 00:00:00 2001 From: rsundriyal Date: Wed, 28 Aug 2024 13:50:35 -0400 Subject: [PATCH 2/5] Typo Fix --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 38892aa5a0..65e8e32617 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -89,7 +89,7 @@ pipeline { dir(path: 'docs/html') { sh """# Move the clamav-documentation here. -// cp -r ../../clamav_documentation/* . + cp -r ../../clamav_documentation/* . # Clean-up rm -rf ../../clamav_documentation rm -rf .git .nojekyll CNAME Placeholder || true From c2eef79e251b95e7055cc39267e28cdf23fce9f0 Mon Sep 17 00:00:00 2001 From: rsundriyal Date: Wed, 11 Sep 2024 13:21:06 -0400 Subject: [PATCH 3/5] Adding failFast false to continue parallel stages if one fails. --- Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 65e8e32617..962738dadf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -147,6 +147,7 @@ pipeline { } stage('Tests') { + failFast false parallel { stage('Pipeline') { stages{ @@ -154,19 +155,21 @@ pipeline { stage("Package") { steps { script{ - regularResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_PIPELINE}", + packageResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_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: 'TESTS_BRANCH', value: "${params.TESTS_BRANCH}"], + [$class: 'StringParameterValue', name: 'BUILD_JOB_NAME', value: "${params.BUILD_PIPELINES_PATH}/${params.BUILD_PIPELINE}"], + [$class: 'StringParameterValue', name: 'BUILD_JOB_NUMBER', value: "${buildResult.number}"], [$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 "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_PIPELINE} #${regularResult.number} succeeded." + echo "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_PIPELINE} #${packageResult.number} succeeded." } } } From 44bd7a1ad5d7bb048915a1a74154b7b125eca9a9 Mon Sep 17 00:00:00 2001 From: rsundriyal Date: Thu, 12 Sep 2024 14:46:53 -0400 Subject: [PATCH 4/5] Adding catchError to continue test stages --- Jenkinsfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 962738dadf..916dc7decc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -89,7 +89,7 @@ pipeline { dir(path: 'docs/html') { sh """# Move the clamav-documentation here. - cp -r ../../clamav_documentation/* . + cp -r ../../clamav_documentation/ . # Clean-up rm -rf ../../clamav_documentation rm -rf .git .nojekyll CNAME Placeholder || true @@ -154,7 +154,8 @@ pipeline { // Regular and custom tests run sequentially on same infra stage("Package") { steps { - script{ + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + script{ packageResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_PIPELINE}", propagate: true, wait: true, @@ -171,12 +172,14 @@ pipeline { ) echo "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_PIPELINE} #${packageResult.number} succeeded." } + } } } stage("Regular From-Source") { steps { - script{ + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + script{ regularResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.REGULAR_PIPELINE}", propagate: true, wait: true, @@ -191,6 +194,7 @@ pipeline { ) echo "${params.TEST_PIPELINES_PATH}/${params.REGULAR_PIPELINE} #${regularResult.number} succeeded." } + } } } From d8e89ebe6107347462e79a498f4a909cf4cccf17 Mon Sep 17 00:00:00 2001 From: rsundriyal Date: Fri, 13 Sep 2024 16:33:50 -0400 Subject: [PATCH 5/5] Code Review changes --- Jenkinsfile | 61 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 916dc7decc..3b3b1aa924 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -151,27 +151,26 @@ pipeline { parallel { stage('Pipeline') { stages{ - // Regular and custom tests run sequentially on same infra stage("Package") { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { script{ - packageResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_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: 'TESTS_BRANCH', value: "${params.TESTS_BRANCH}"], - [$class: 'StringParameterValue', name: 'BUILD_JOB_NAME', value: "${params.BUILD_PIPELINES_PATH}/${params.BUILD_PIPELINE}"], - [$class: 'StringParameterValue', name: 'BUILD_JOB_NUMBER', value: "${buildResult.number}"], - [$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 "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_PIPELINE} #${packageResult.number} succeeded." - } + packageResult = build(job: "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_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: 'TESTS_BRANCH', value: "${params.TESTS_BRANCH}"], + [$class: 'StringParameterValue', name: 'BUILD_JOB_NAME', value: "${params.BUILD_PIPELINES_PATH}/${params.BUILD_PIPELINE}"], + [$class: 'StringParameterValue', name: 'BUILD_JOB_NUMBER', value: "${buildResult.number}"], + [$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 "${params.TEST_PIPELINES_PATH}/${params.PACKAGE_PIPELINE} #${packageResult.number} succeeded." + } } } } @@ -180,20 +179,20 @@ pipeline { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { script{ - 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: '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 "${params.TEST_PIPELINES_PATH}/${params.REGULAR_PIPELINE} #${regularResult.number} succeeded." - } + 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: '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 "${params.TEST_PIPELINES_PATH}/${params.REGULAR_PIPELINE} #${regularResult.number} succeeded." + } } } }