Skip to content

Commit

Permalink
Validate distribution while building RC (#5269)
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <[email protected]>
  • Loading branch information
gaiksaya authored Jan 28, 2025
1 parent f5404f2 commit fc605b7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
22 changes: 22 additions & 0 deletions jenkins/opensearch-dashboards/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ pipeline {
paramType.each { key, value ->
verifyParameterPlatformDistribution(key, value)
}

def inputManifestObj = lib.jenkins.InputManifest.new(readYaml(file: "manifests/${INPUT_MANIFEST}"))
env.version = inputManifestObj.build.version
}
}
}
Expand Down Expand Up @@ -953,6 +956,9 @@ pipeline {
success {
node(AGENT_LINUX_X64) {
script {
if (params.RC_NUMBER.toInteger() > 0) {
triggerDistributionValidationWorkflow(env.version)
}
postCleanup()
}
}
Expand Down Expand Up @@ -1008,6 +1014,22 @@ def triggerBWCTests(String buildManifestUrl, String platform, String distributio
}
}

def triggerDistributionValidationWorkflow(String version) {
def triggerValidationWorkflow =
build job: 'distribution-validation',
propagate: true,
wait: true,
parameters: [
string(name: 'VERSION', value: version),
string(name: 'OS_BUILD_NUMBER', value: 'latest'),
string(name: 'OSD_BUILD_NUMBER', value: BUILD_NUMBER),
string(name: 'OPTIONAL_ARGS', value: 'using-staging-artifact-only'),
string(name: 'DOCKER_SOURCE', value: 'dockerhub'),
string(name: 'PROJECTS', value: 'Both'),
string(name: 'ARTIFACT_TYPE', value: 'staging')
]
}

def verifyParameterPlatformDistribution(String paramName, String allowedValue) {
echo("Verify Parameter '$paramName'")
def paramValue = env."$paramName"
Expand Down
21 changes: 21 additions & 0 deletions jenkins/opensearch/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ pipeline {
paramType.each { key, value ->
verifyParameterPlatformDistribution(key, value)
}

def inputManifestObj = lib.jenkins.InputManifest.new(readYaml(file: "manifests/${INPUT_MANIFEST}"))
env.version = inputManifestObj.build.version
}
}
}
Expand Down Expand Up @@ -914,6 +917,9 @@ pipeline {
success {
node(AGENT_LINUX_X64) {
script {
if (params.RC_NUMBER.toInteger() > 0) {
triggerDistributionValidationWorkflow(env.version)
}
postCleanup()
}
}
Expand Down Expand Up @@ -969,6 +975,21 @@ def triggerBWCTests(String buildManifestUrl, String platform, String distributio
}
}

def triggerDistributionValidationWorkflow(String version) {
def triggerValidationWorkflow =
build job: 'distribution-validation',
propagate: true,
wait: true,
parameters: [
string(name: 'VERSION', value: version),
string(name: 'OS_BUILD_NUMBER', value: BUILD_NUMBER),
string(name: 'OPTIONAL_ARGS', value: 'using-staging-artifact-only'),
string(name: 'DOCKER_SOURCE', value: 'dockerhub'),
string(name: 'PROJECTS', value: 'opensearch'),
string(name: 'ARTIFACT_TYPE', value: 'staging')
]
}

def verifyParameterPlatformDistribution(String paramName, String allowedValue) {
echo("Verify Parameter '$paramName'")
def paramValue = env."$paramName"
Expand Down

0 comments on commit fc605b7

Please sign in to comment.