Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private <T extends IdentifiableObject> TypeReport handleCreates( Session session

preheatService.connectReferences( object, bundle.getPreheat(), bundle.getPreheatIdentifier() );

session.save(object);
session.save( object );

bundle.getPreheat().replace( bundle.getPreheatIdentifier(), object );

Expand Down Expand Up @@ -291,7 +291,7 @@ private <T extends IdentifiableObject> TypeReport handleUpdates( Session session
.setSkipTranslation( bundle.isSkipTranslation() ) );
}

session.update(persistedObject);
session.update( persistedObject );

bundle.getPreheat().replace( bundle.getPreheatIdentifier(), persistedObject );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public class ObjectBundle implements ObjectIndexProvider
private final User user;

/**
* Should import be imported or just validated.
*/
* Should import be imported or just validated.
*/
private final ObjectBundleMode objectBundleMode;

/**
Expand Down Expand Up @@ -195,8 +195,6 @@ public User getUser()
return user;
}



public String getUsername()
{
return user != null ? user.getUsername() : "system-process";
Expand Down
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-jre11"
}

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-e2e-test') {
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-e2e-test') {
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