Skip to content

Commit 4cb3620

Browse files
authored
ci: build and publish EOS docker image (#24163)
1 parent 209db38 commit 4cb3620

1 file changed

Lines changed: 44 additions & 1 deletion

File tree

  • jenkinsfiles

jenkinsfiles/eos

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@ pipeline {
1313

1414
options {
1515
buildDiscarder(logRotator(numToKeepStr: '5'))
16-
timeout(time: 30)
16+
timeout(time: 60)
1717
}
1818

1919
environment {
2020
MAVEN_OPTS = '-Xms1024m -Xmx4096m -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=125'
21+
DHIS2_VERSION = readMavenPom(file: 'dhis-2/pom.xml').getVersion()
22+
DOCKER_IMAGE_NAME = "${DOCKER_HUB_OWNER}/core"
23+
DOCKER_IMAGE_TAG = "${env.GIT_BRANCH}-eos"
24+
DOCKER_IMAGE_NAME_FULL = "${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}"
25+
IMAGE_REPOSITORY = "${DOCKER_IMAGE_NAME}"
26+
// Tomcat base for the build-docker-image.sh path; keep in sync with the dev/stable pipelines.
27+
BASE_IMAGE = "tomcat:10.1.48-jre17"
2128
}
2229

2330
stages {
@@ -32,6 +39,42 @@ pipeline {
3239
}
3340
}
3441

42+
stage ('Build and publish Docker image') {
43+
steps {
44+
withDockerRegistry([credentialsId: "docker-hub-credentials", url: ""]) {
45+
withMaven(options: [artifactsPublisher(disabled: true)]) {
46+
// EOS maintenance build: publish a single rolling "<major.minor>-eos" tag.
47+
// -d skips the immutable timestamp and rolling M/M.m tags (reserved for releases).
48+
sh './dhis-2/build-docker-image.sh -t "${DOCKER_IMAGE_TAG}" -d'
49+
}
50+
}
51+
}
52+
}
53+
54+
stage ('Smoke test') {
55+
steps {
56+
// Non-blocking: a stale e2e suite must not block publishing the EOS image.
57+
catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE', message: 'EOS smoke test failed') {
58+
dir('dhis-2/dhis-test-e2e') {
59+
sh "docker pull ${DOCKER_IMAGE_NAME_FULL}"
60+
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"
61+
}
62+
}
63+
}
64+
65+
post {
66+
always {
67+
script {
68+
dir('dhis-2/dhis-test-e2e') {
69+
archiveArtifacts artifacts: 'coverage.csv', allowEmptyArchive: true
70+
sh 'docker compose logs web > web-logs.txt || true'
71+
archiveArtifacts artifacts: 'web-logs.txt', allowEmptyArchive: true
72+
}
73+
}
74+
}
75+
}
76+
}
77+
3578
stage ('Sync WAR') {
3679
steps {
3780
echo 'Syncing WAR ...'

0 commit comments

Comments
 (0)