From 6f8f8c2962952ee8c8ac7ec33732861ce7f6ee95 Mon Sep 17 00:00:00 2001 From: Adrian Clay Date: Fri, 26 Jul 2024 11:44:03 +0100 Subject: [PATCH 1/2] Publish the SNOMED schema docker image to ECR as part of build --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 33070aea3..86be834af 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,6 +3,7 @@ String tfComponent = "pss" Boolean publishGPC_FacadeImage = true // true: to publish gpc_facade image to AWS ECR gpc_facade Boolean publishGP2GP_TranslatorImage = true // true: to publish gp2gp_translator image to AWS ECR gp2gp-translator Boolean publishMhsMockImage = true // true: to publish mhs mock image to AWS ECR pss-mock-mhs +Boolean publishSnomedSchemaImage = true // true: to publish SNOMED schema image to AWS ECR pss_snomed_schema pipeline { @@ -21,10 +22,12 @@ pipeline { GPC_FACADE_ECR_REPO_DIR = "pss_gpc_facade" GP2GP_TRANSLATOR_ECR_REPO_DIR = "pss_gp2gp-translator" + SNOMED_SCHEMA_ECR_REPO_DIR = "pss_snomed_schema" MHS_MOCK_ECR_REPO_DIR = "pss-mock-mhs" GPC_FACADE_DOCKER_IMAGE = "${DOCKER_REGISTRY}/${GPC_FACADE_ECR_REPO_DIR}:${BUILD_TAG}" GP2GP_TRANSLATOR_DOCKER_IMAGE = "${DOCKER_REGISTRY}/${GP2GP_TRANSLATOR_ECR_REPO_DIR}:${BUILD_TAG}" + SNOMED_SCHEMA_DOCKER_IMAGE = "${DOCKER_REGISTRY}/${SNOMED_SCHEMA_ECR_REPO_DIR}:${BUILD_TAG}" MHS_MOCK_DOCKER_IMAGE = "${DOCKER_REGISTRY}/${MHS_MOCK_ECR_REPO_DIR}:${BUILD_TAG}" } @@ -148,6 +151,9 @@ pipeline { if (publishGP2GP_TranslatorImage) { if (sh(label: "Running ${GP2GP_TRANSLATOR_ECR_REPO_DIR} docker build", script: 'docker build -f docker/gp2gp-translator/Dockerfile -t ${GP2GP_TRANSLATOR_DOCKER_IMAGE} .', returnStatus: true) != 0) {error("Failed to build ${GP2GP_TRANSLATOR_ECR_REPO_DIR} Docker image")} } + if (publishSnomedSchemaImage) { + if (sh(label: "Running ${GP2GP_TRANSLATOR_ECR_REPO_DIR} docker build", script: 'docker build -f docker/snomed-schema/Dockerfile -t ${SNOMED_SCHEMA_DOCKER_IMAGE} .', returnStatus: true) != 0) {error("Failed to build ${SNOMED_SCHEMA_ECR_REPO_DIR} Docker image")} + } if (publishMhsMockImage) { if (sh(label: "Running ${MHS_MOCK_ECR_REPO_DIR} docker build", script: 'docker build -f docker/mhs-adaptor-mock/Dockerfile -t ${MHS_MOCK_DOCKER_IMAGE} docker/mhs-adaptor-mock', returnStatus: true) != 0) {error("Failed to build ${MHS_MOCK_ECR_REPO_DIR} Docker image")} } @@ -176,6 +182,10 @@ pipeline { if (sh(label: "Pushing GP2GP_Translator image", script: "docker push ${GP2GP_TRANSLATOR_DOCKER_IMAGE}", returnStatus: true) != 0) {error("Docker push ${GP2GP_TRANSLATOR_ECR_REPO_DIR} image failed") } } + if (publishSnomedSchemaImage) { + if (sh(label: "Pushing SNOMED Schema image", script: "docker push ${SNOMED_SCHEMA_DOCKER_IMAGE}", returnStatus: true) != 0) {error("Docker push ${SNOMED_SCHEMA_ECR_REPO_DIR} image failed") } + } + } } // steps } //stage push images From 5b6611cfc048c6d6a6b5824c82a26298ddd5cb2a Mon Sep 17 00:00:00 2001 From: Adrian Clay Date: Fri, 26 Jul 2024 12:00:29 +0100 Subject: [PATCH 2/2] Publish the DB migration docker image to ECR as part of build --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 86be834af..f4ff718b3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,7 @@ Boolean publishGPC_FacadeImage = true // true: to publish gpc_facade image to A Boolean publishGP2GP_TranslatorImage = true // true: to publish gp2gp_translator image to AWS ECR gp2gp-translator Boolean publishMhsMockImage = true // true: to publish mhs mock image to AWS ECR pss-mock-mhs Boolean publishSnomedSchemaImage = true // true: to publish SNOMED schema image to AWS ECR pss_snomed_schema +Boolean publishDbMigrationImage = true // true: to publish DB migration image to AWS ECR pss_db_migration pipeline { @@ -23,11 +24,13 @@ pipeline { GPC_FACADE_ECR_REPO_DIR = "pss_gpc_facade" GP2GP_TRANSLATOR_ECR_REPO_DIR = "pss_gp2gp-translator" SNOMED_SCHEMA_ECR_REPO_DIR = "pss_snomed_schema" + DB_MIGRATION_ECR_REPO_DIR = "pss_db_migration" MHS_MOCK_ECR_REPO_DIR = "pss-mock-mhs" GPC_FACADE_DOCKER_IMAGE = "${DOCKER_REGISTRY}/${GPC_FACADE_ECR_REPO_DIR}:${BUILD_TAG}" GP2GP_TRANSLATOR_DOCKER_IMAGE = "${DOCKER_REGISTRY}/${GP2GP_TRANSLATOR_ECR_REPO_DIR}:${BUILD_TAG}" SNOMED_SCHEMA_DOCKER_IMAGE = "${DOCKER_REGISTRY}/${SNOMED_SCHEMA_ECR_REPO_DIR}:${BUILD_TAG}" + DB_MIGRATION_DOCKER_IMAGE = "${DOCKER_REGISTRY}/${DB_MIGRATION_ECR_REPO_DIR}:${BUILD_TAG}" MHS_MOCK_DOCKER_IMAGE = "${DOCKER_REGISTRY}/${MHS_MOCK_ECR_REPO_DIR}:${BUILD_TAG}" } @@ -154,6 +157,9 @@ pipeline { if (publishSnomedSchemaImage) { if (sh(label: "Running ${GP2GP_TRANSLATOR_ECR_REPO_DIR} docker build", script: 'docker build -f docker/snomed-schema/Dockerfile -t ${SNOMED_SCHEMA_DOCKER_IMAGE} .', returnStatus: true) != 0) {error("Failed to build ${SNOMED_SCHEMA_ECR_REPO_DIR} Docker image")} } + if (publishDbMigrationImage) { + if (sh(label: "Running ${DB_MIGRATION_ECR_REPO_DIR} docker build", script: 'docker build -f docker/db-migration/Dockerfile -t ${DB_MIGRATION_DOCKER_IMAGE} .', returnStatus: true) != 0) {error("Failed to build ${DB_MIGRATION_ECR_REPO_DIR} Docker image")} + } if (publishMhsMockImage) { if (sh(label: "Running ${MHS_MOCK_ECR_REPO_DIR} docker build", script: 'docker build -f docker/mhs-adaptor-mock/Dockerfile -t ${MHS_MOCK_DOCKER_IMAGE} docker/mhs-adaptor-mock', returnStatus: true) != 0) {error("Failed to build ${MHS_MOCK_ECR_REPO_DIR} Docker image")} } @@ -186,6 +192,10 @@ pipeline { if (sh(label: "Pushing SNOMED Schema image", script: "docker push ${SNOMED_SCHEMA_DOCKER_IMAGE}", returnStatus: true) != 0) {error("Docker push ${SNOMED_SCHEMA_ECR_REPO_DIR} image failed") } } + if (publishDbMigrationImage) { + if (sh(label: "Pushing DB migration image", script: "docker push ${DB_MIGRATION_DOCKER_IMAGE}", returnStatus: true) != 0) {error("Docker push ${DB_MIGRATION_ECR_REPO_DIR} image failed") } + } + } } // steps } //stage push images