From 277672cdce1a31fecabe137d2531b2fab992b35f Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 29 Aug 2024 15:42:10 -0400 Subject: [PATCH] Allow empty TEST paramsters in distribution build workflows (#4983) Signed-off-by: Peter Zhu --- .../distribution-build.jenkinsfile | 11 +++++++++-- jenkins/opensearch/distribution-build.jenkinsfile | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/jenkins/opensearch-dashboards/distribution-build.jenkinsfile b/jenkins/opensearch-dashboards/distribution-build.jenkinsfile index c0c7a4ca6d..2581de7b72 100644 --- a/jenkins/opensearch-dashboards/distribution-build.jenkinsfile +++ b/jenkins/opensearch-dashboards/distribution-build.jenkinsfile @@ -69,13 +69,11 @@ pipeline { string( // Note: need to update 'verify-parameters' entries if you add new platform(s) name: 'TEST_PLATFORM', description: "Test selected platform, choices include 'linux', 'windows'. Can combine multiple platforms with space in between (docker is only available on linux)", - defaultValue: 'linux windows', trim: true ) string( // Note: need to update 'verify-parameters' entries if you add new distribution(s) name: 'TEST_DISTRIBUTION', description: "Build selected distribution, choices include 'tar', 'rpm', 'deb', 'zip'. Can combine multiple distributions with space in between (docker is only available on tar)", - defaultValue: 'tar rpm deb zip', trim: true ) string( @@ -143,6 +141,15 @@ pipeline { 'TEST_DISTRIBUTION': 'tar rpm deb zip', ] + // BUILD params are required while TEST params are not + if (params.TEST_PLATFORM == null || params.TEST_PLATFORM == '') { + paramType.remove('TEST_PLATFORM') + } + + if (params.TEST_DISTRIBUTION == null || params.TEST_DISTRIBUTION == '') { + paramType.remove('TEST_DISTRIBUTION') + } + paramType.each { key, value -> verifyParameterPlatformDistribution(key, value) } diff --git a/jenkins/opensearch/distribution-build.jenkinsfile b/jenkins/opensearch/distribution-build.jenkinsfile index 7aa29d0f46..f66f7f714d 100644 --- a/jenkins/opensearch/distribution-build.jenkinsfile +++ b/jenkins/opensearch/distribution-build.jenkinsfile @@ -68,13 +68,11 @@ pipeline { string( // Note: need to update 'verify-parameters' entries if you add new platform(s) name: 'TEST_PLATFORM', description: "Test selected platform, choices include 'linux', 'windows'. Can combine multiple platforms with space in between (docker is only available on linux)", - defaultValue: 'linux windows', trim: true ) string( // Note: need to update 'verify-parameters' entries if you add new distribution(s) name: 'TEST_DISTRIBUTION', description: "Build selected distribution, choices include 'tar', 'rpm', 'deb', 'zip'. Can combine multiple distributions with space in between (docker is only available on tar)", - defaultValue: 'tar rpm deb zip', trim: true ) string( @@ -143,6 +141,15 @@ pipeline { 'TEST_DISTRIBUTION': 'tar rpm deb zip', ] + // BUILD params are required while TEST params are not + if (params.TEST_PLATFORM == null || params.TEST_PLATFORM == '') { + paramType.remove('TEST_PLATFORM') + } + + if (params.TEST_DISTRIBUTION == null || params.TEST_DISTRIBUTION == '') { + paramType.remove('TEST_DISTRIBUTION') + } + paramType.each { key, value -> verifyParameterPlatformDistribution(key, value) }