/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. */ pipeline { agent none stages { stage("Image Copy") { stages { stage('Parameters Check') { steps { script { currentBuild.description = "${SOURCE_IMAGE_REGISTRY}/${SOURCE_IMAGE} to ${DESTINATION_IMAGE_REGISTRY}/${DESTINATION_IMAGE}" if( SOURCE_IMAGE.isEmpty() || DESTINATION_IMAGE.isEmpty()) { currentBuild.result = 'ABORTED' error('Make sure all the parameters are passed in.') } } } } stage('Copy Image to ECR/DockerHub') { steps { script { copyContainer( sourceImage: "${SOURCE_IMAGE}", sourceRegistry: "${SOURCE_IMAGE_REGISTRY}", destinationImage: "${DESTINATION_IMAGE}", destinationRegistry: "public.ecr.aws/opensearchstaging" ) } } } } } } }