From 0f6eec9c1f5e4d946d9ed546be121a704700c2f2 Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad <61760125+gaiksaya@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:42:25 -0700 Subject: [PATCH] Fix the docker promotion parameter types (#4812) Signed-off-by: Sayali Gaikawad --- jenkins/promotion/release-promotion.jenkinsfile | 8 ++++---- tests/jenkins/TestOpenSearchReleasePromotionTest.groovy | 8 ++++---- .../promotion/release-promotion.jenkinsfile.txt | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/jenkins/promotion/release-promotion.jenkinsfile b/jenkins/promotion/release-promotion.jenkinsfile index e19f6d32d5..c3abd1e9a6 100644 --- a/jenkins/promotion/release-promotion.jenkinsfile +++ b/jenkins/promotion/release-promotion.jenkinsfile @@ -468,10 +468,10 @@ pipeline { build job: 'docker-promotion', wait: true, parameters: [ string(name: 'SOURCE_IMAGES', value: "opensearch:${params.RELEASE_VERSION}.${params.OPENSEARCH_RC_BUILD_NUMBER}, opensearch-dashboards:${params.RELEASE_VERSION}.${params.OPENSEARCH_DASHBOARDS_RC_BUILD_NUMBER}"), string(name: 'RELEASE_VERSION', value: "${params.RELEASE_VERSION}"), - string(name: 'DOCKER_HUB_PROMOTE', value: true), - string(name: 'ECR_PROMOTE', value: true), - string(name: 'TAG_LATEST', value: "${params.TAG_DOCKER_LATEST}"), - string(name: 'TAG_MAJOR_VERSION', value: true) + booleanParam(name: 'DOCKER_HUB_PROMOTE', value: true), + booleanParam(name: 'ECR_PROMOTE', value: true), + booleanParam(name: 'TAG_LATEST', value: "${params.TAG_DOCKER_LATEST}"), + booleanParam(name: 'TAG_MAJOR_VERSION', value: true) ] echo 'Promoted Docker successfully!' } diff --git a/tests/jenkins/TestOpenSearchReleasePromotionTest.groovy b/tests/jenkins/TestOpenSearchReleasePromotionTest.groovy index 77e8f87265..052868d373 100644 --- a/tests/jenkins/TestOpenSearchReleasePromotionTest.groovy +++ b/tests/jenkins/TestOpenSearchReleasePromotionTest.groovy @@ -174,10 +174,10 @@ class TestOpenSearchReleasePromotionTest extends BuildPipelineTest { assertCallStack().contains('stage(Promote Docker, groovy.lang.Closure)') assertCallStack().contains('release-promotion.string({name=SOURCE_IMAGES, value=opensearch:1.0.0.2050, opensearch-dashboards:1.0.0.3050})') assertCallStack().contains('release-promotion.string({name=RELEASE_VERSION, value=1.0.0})') - assertCallStack().contains('release-promotion.string({name=DOCKER_HUB_PROMOTE, value=true})') - assertCallStack().contains('release-promotion.string({name=ECR_PROMOTE, value=true})') - assertCallStack().contains('release-promotion.string({name=TAG_LATEST, value=true})') - assertCallStack().contains('release-promotion.string({name=TAG_MAJOR_VERSION, value=true})') + assertCallStack().contains('release-promotion.booleanParam({name=DOCKER_HUB_PROMOTE, value=true})') + assertCallStack().contains('release-promotion.booleanParam({name=ECR_PROMOTE, value=true})') + assertCallStack().contains('release-promotion.booleanParam({name=TAG_LATEST, value=true})') + assertCallStack().contains('release-promotion.booleanParam({name=TAG_MAJOR_VERSION, value=true})') assertCallStack().contains('release-promotion.build({job=docker-promotion, wait=true, parameters=[null, null, null, null, null, null]})') // Validation Workflow diff --git a/tests/jenkins/jenkinsjob-regression-files/promotion/release-promotion.jenkinsfile.txt b/tests/jenkins/jenkinsjob-regression-files/promotion/release-promotion.jenkinsfile.txt index bad0932607..d7328c9cc2 100644 --- a/tests/jenkins/jenkinsjob-regression-files/promotion/release-promotion.jenkinsfile.txt +++ b/tests/jenkins/jenkinsjob-regression-files/promotion/release-promotion.jenkinsfile.txt @@ -211,10 +211,10 @@ release-promotion.echo(Triggering docker promotion) release-promotion.string({name=SOURCE_IMAGES, value=opensearch:1.0.0.2050, opensearch-dashboards:1.0.0.3050}) release-promotion.string({name=RELEASE_VERSION, value=1.0.0}) - release-promotion.string({name=DOCKER_HUB_PROMOTE, value=true}) - release-promotion.string({name=ECR_PROMOTE, value=true}) - release-promotion.string({name=TAG_LATEST, value=true}) - release-promotion.string({name=TAG_MAJOR_VERSION, value=true}) + release-promotion.booleanParam({name=DOCKER_HUB_PROMOTE, value=true}) + release-promotion.booleanParam({name=ECR_PROMOTE, value=true}) + release-promotion.booleanParam({name=TAG_LATEST, value=true}) + release-promotion.booleanParam({name=TAG_MAJOR_VERSION, value=true}) release-promotion.build({job=docker-promotion, wait=true, parameters=[null, null, null, null, null, null]}) release-promotion.echo(Promoted Docker successfully!) release-promotion.stage(Validate the artifacts, groovy.lang.Closure)