Skip to content

Commit

Permalink
Allow empty TEST paramsters in distribution build workflows (#4983)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Aug 29, 2024
1 parent 67baaac commit 277672c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions jenkins/opensearch-dashboards/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
}
Expand Down
11 changes: 9 additions & 2 deletions jenkins/opensearch/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 277672c

Please sign in to comment.