diff --git a/jenkinsfiles/canary b/jenkinsfiles/canary index 2a1c9b9fbbb6..bffea6d9cb2d 100644 --- a/jenkinsfiles/canary +++ b/jenkinsfiles/canary @@ -13,7 +13,7 @@ pipeline { options { buildDiscarder(logRotator(numToKeepStr: '5')) - timeout(time: 30) + timeout(time: 45) } environment { @@ -42,6 +42,36 @@ pipeline { } } + stage ('Build') { + steps { + echo 'Building DHIS2 ...' + script { + withMaven(options: [artifactsPublisher(disabled: true)]) { + sh 'mvn -X -T 4 --batch-mode --no-transfer-progress clean install -f dhis-2/pom.xml -P -default --update-snapshots -pl -dhis-web-embedded-jetty' + sh 'mvn -X -T 4 --batch-mode --no-transfer-progress package -f dhis-2/dhis-web/pom.xml -P -default --update-snapshots' + } + } + } + } + + stage ('Sync WAR') { + steps { + echo 'Syncing WAR ...' + sh 'curl "https://raw.githubusercontent.com/dhis2/dhis2-server-setup/master/ci/scripts/copy-war-s3.sh" -O' + sh 'chmod +x copy-war-s3.sh' + sh './copy-war-s3.sh canary ${GIT_BRANCH}' + } + } + + stage ('Delete old WARs') { + steps { + echo 'Deleting old WARs ...' + sh 'curl "https://raw.githubusercontent.com/dhis2/dhis2-server-setup/master/ci/scripts/delete-old-wars.sh" -O' + sh 'chmod +x delete-old-wars.sh' + sh './delete-old-wars.sh ${GIT_BRANCH}' + } + } + stage('Update IM Play instance') { environment { HTTP = "http --check-status" @@ -86,7 +116,7 @@ pipeline { dir('scripts/instances') { sh "(./findByName.sh play nightly${branch} && ./restart.sh play nightly${branch}) || ./deploy-dhis2.sh play nightly${branch}" - timeout(5) { + timeout(10) { waitFor.statusOk("${env.INSTANCE_URL}${branch}") } } @@ -95,62 +125,6 @@ pipeline { } } } - - stage ('Build') { - steps { - echo 'Building DHIS2 ...' - script { - withMaven(options: [artifactsPublisher(disabled: true)]) { - sh 'mvn -X -T 4 --batch-mode --no-transfer-progress clean install -f dhis-2/pom.xml -P -default --update-snapshots -pl -dhis-web-embedded-jetty' - sh 'mvn -X -T 4 --batch-mode --no-transfer-progress package -f dhis-2/dhis-web/pom.xml -P -default --update-snapshots' - } - } - } - } - - stage ('Sync WAR') { - steps { - echo 'Syncing WAR ...' - sh 'curl "https://raw.githubusercontent.com/dhis2/dhis2-server-setup/master/ci/scripts/copy-war-s3.sh" -O' - sh 'chmod +x copy-war-s3.sh' - sh './copy-war-s3.sh canary ${GIT_BRANCH}' - } - } - - stage ('Delete old WARs') { - steps { - echo 'Deleting old WARs ...' - sh 'curl "https://raw.githubusercontent.com/dhis2/dhis2-server-setup/master/ci/scripts/delete-old-wars.sh" -O' - sh 'chmod +x delete-old-wars.sh' - sh './delete-old-wars.sh ${GIT_BRANCH}' - } - } - - stage ('Generate Javadocs') { - steps { - echo 'Generating Javadocs ...' - script { - withMaven(options: [artifactsPublisher(disabled: true)]) { - sh 'mvn --batch-mode --no-transfer-progress clean install javadoc:aggregate -Pjavadoc -DskipTests=true -Dmaven.test.skip=true -f dhis-2/pom.xml' - } - } - } - - post { - success { - javadoc javadocDir: 'dhis-2/target/site/apidocs', keepAll: false - } - } - } - - stage ('Sync Javadocs') { - steps { - echo 'Syncing Javadocs ...' - sh 'curl "https://raw.githubusercontent.com/dhis2/dhis2-server-setup/master/ci/scripts/sync-javadocs-s3.sh" -O' - sh 'chmod +x sync-javadocs-s3.sh' - sh './sync-javadocs-s3.sh ${GIT_BRANCH}' - } - } } post {