From 85fecaae027706b9957669c27e472622b7082618 Mon Sep 17 00:00:00 2001 From: Rado Date: Tue, 9 Jun 2026 15:26:46 +0300 Subject: [PATCH] ci: build and publish EOS docker image --- jenkinsfiles/eos | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/jenkinsfiles/eos b/jenkinsfiles/eos index 6adf3676089f..594de9d6dbaa 100644 --- a/jenkinsfiles/eos +++ b/jenkinsfiles/eos @@ -13,11 +13,18 @@ pipeline { options { buildDiscarder(logRotator(numToKeepStr: '5')) - timeout(time: 30) + timeout(time: 60) } environment { MAVEN_OPTS = '-Xms1024m -Xmx4096m -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=125' + DHIS2_VERSION = readMavenPom(file: 'dhis-2/pom.xml').getVersion() + DOCKER_IMAGE_NAME = "${DOCKER_HUB_OWNER}/core" + DOCKER_IMAGE_TAG = "${env.GIT_BRANCH}-eos" + DOCKER_IMAGE_NAME_FULL = "${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}" + IMAGE_REPOSITORY = "${DOCKER_IMAGE_NAME}" + // THIS MUST be kept in sync with the jib.from.image in the dhis-web-portal pom.xml + BASE_IMAGE = "tomcat:9.0.96-jre11" } stages { @@ -33,6 +40,42 @@ pipeline { } } + stage ('Build and publish Docker image') { + steps { + withDockerRegistry([credentialsId: "docker-hub-credentials", url: ""]) { + withMaven(options: [artifactsPublisher(disabled: true)]) { + // EOS maintenance build: publish a single rolling "-eos" tag. + // -d skips the immutable timestamp and rolling M/M.m tags (reserved for releases). + sh './dhis-2/build-docker-image.sh -t "${DOCKER_IMAGE_TAG}" -d' + } + } + } + } + + stage ('Smoke test') { + steps { + // Non-blocking: a stale e2e suite must not block publishing the EOS image. + catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE', message: 'EOS smoke test failed') { + dir('dhis-2/dhis-test-e2e') { + sh "docker pull ${DOCKER_IMAGE_NAME_FULL}" + sh "DHIS2_IMAGE=${DOCKER_IMAGE_NAME_FULL} docker compose --file docker-compose.yml --file docker-compose.e2e.yml up --remove-orphans --exit-code-from test" + } + } + } + + post { + always { + script { + dir('dhis-2/dhis-test-e2e') { + archiveArtifacts artifacts: 'coverage.csv', allowEmptyArchive: true + sh 'docker compose logs web > web-logs.txt || true' + archiveArtifacts artifacts: 'web-logs.txt', allowEmptyArchive: true + } + } + } + } + } + stage ('Sync WAR') { steps { echo 'Syncing WAR ...'