From 2b881836cf06384c642c6c82d5b306249770b034 Mon Sep 17 00:00:00 2001 From: Prudhvi Godithi Date: Thu, 1 Feb 2024 13:17:13 -0800 Subject: [PATCH] Update Jenkinsfile to add ECR staging registry (#713) ### Description Update Jenkinsfile to add ECR staging registry ### Issues Resolved Part of https://github.com/opensearch-project/opensearch-k8s-operator/issues/709 and https://github.com/opensearch-project/opensearch-k8s-operator/issues/674 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). Signed-off-by: Prudhvi Godithi --- jenkins/release.jenkinsfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/jenkins/release.jenkinsfile b/jenkins/release.jenkinsfile index dc6b6291..0a596693 100644 --- a/jenkins/release.jenkinsfile +++ b/jenkins/release.jenkinsfile @@ -81,6 +81,7 @@ pipeline { echo("${OPERATOR_PRODUCT}: ${OPERATOR_VERSION}") + // Build and push to dockerhub staging repo https://hub.docker.com/r/opensearchstaging/opensearch-operator. dockerBuild: { build job: 'docker-build', parameters: [ @@ -100,6 +101,19 @@ pipeline { ].join(' && ')), ] } + // This is required to copy the operator to staging ECR https://gallery.ecr.aws/opensearchstaging/opensearch-operator repo as the docker-promotion job does not promote to staging ECR. + dockerCopy: { + build job: 'docker-copy', + parameters: [ + string(name: 'SOURCE_IMAGE_REGISTRY', value: 'opensearchstaging'), + string(name: 'SOURCE_IMAGE', value: "${OPERATOR_PRODUCT}:${OPERATOR_VERSION}"), + string(name: 'DESTINATION_IMAGE_REGISTRY', value: 'public.ecr.aws/opensearchstaging'), + string(name: 'DESTINATION_IMAGE', value: "${OPERATOR_PRODUCT}:${OPERATOR_VERSION}") + ] + } + + // Promote to DockerHub Prod https://hub.docker.com/r/opensearchproject/opensearch-operator repo. + // Promote to ECR Prod https://gallery.ecr.aws/opensearchproject/opensearch-operator repo. dockerPromotion: { build job: 'docker-promotion', parameters: [