Skip to content

Commit 3a0830c

Browse files
authored
ci: build and publish EOS docker image (#24167)
1 parent 0a9d7c2 commit 3a0830c

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+
// THIS MUST be kept in sync with the jib.from.image in the dhis-web-portal pom.xml
27+
BASE_IMAGE = "tomcat:9.0.96-jre11"
2128
}
2229

2330
stages {
@@ -33,6 +40,42 @@ pipeline {
3340
}
3441
}
3542

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

0 commit comments

Comments
 (0)