Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion jenkinsfiles/eos
Original file line number Diff line number Diff line change
Expand Up @@ -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.111-jre17"
}

stages {
Expand All @@ -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 "<major.minor>-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 ...'
Expand Down
Loading