From 2dde1ad691e94f3762767c504330cd02a5154a20 Mon Sep 17 00:00:00 2001 From: Soner Sivri Date: Tue, 9 Apr 2024 11:18:07 +0300 Subject: [PATCH] chore: [CO-1037] Make nightly build report from devel branch (#476) Co-authored-by: Gianluca Boiano <491117+M0Rf30@users.noreply.github.com> --- Jenkinsfile | 4 +++ Jenkinsfile.nightly | 82 --------------------------------------------- 2 files changed, 4 insertions(+), 82 deletions(-) delete mode 100644 Jenkinsfile.nightly diff --git a/Jenkinsfile b/Jenkinsfile index 6388d943e57..596bfb8359a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -65,6 +65,10 @@ pipeline { } } + triggers { + cron(env.BRANCH_NAME == 'devel' ? 'H 5 * * *' : '') + } + parameters { booleanParam defaultValue: false, description: 'Upload packages in playground repositories.', name: 'PLAYGROUND' booleanParam defaultValue: false, description: 'Skip test and sonar analysis.', name: 'SKIP_TEST_WITH_COVERAGE' diff --git a/Jenkinsfile.nightly b/Jenkinsfile.nightly deleted file mode 100644 index 66b45a65362..00000000000 --- a/Jenkinsfile.nightly +++ /dev/null @@ -1,82 +0,0 @@ -def mvnCmd(String cmd) { - sh 'mvn -B -s settings-jenkins.xml ' + cmd -} - -pipeline { - agent { - node { - label 'carbonio-agent-v2' - } - } - triggers { - cron('H 5 * * *') - } - environment { - JAVA_HOME='/usr/lib/jvm/java-11-openjdk-amd64' - JAVA_PATH='${JAVA_HOME}/bin' - JAVA_OPTS="-Dfile.encoding=UTF8" - LC_ALL="C.UTF-8" - jenkins_build="true" - BUILD_PROPERTIES_PARAMS='-Ddebug=0 -Dis-production=1' - } - options { - buildDiscarder(logRotator(numToKeepStr: '25')) - timeout(time: 2, unit: 'HOURS') - skipDefaultCheckout() - } - stages { - stage('Checkout') { - steps { - checkout scm - withCredentials([file(credentialsId: 'jenkins-maven-settings.xml', variable: 'SETTINGS_PATH')]) { - sh "cp ${SETTINGS_PATH} settings-jenkins.xml" - } - } - } - stage('Build') { - steps { - mvnCmd("$BUILD_PROPERTIES_PARAMS -DskipTests=true clean install") - } - } - stage('Test all with coverage (allow failure)') { - steps { - mvnCmd("$BUILD_PROPERTIES_PARAMS test") - recordCoverage(tools: [[parser: 'JACOCO']],sourceCodeRetention: 'MODIFIED') - junit allowEmptyResults: true, testResults: '**/target/surefire-reports/*.xml' - } - } - } - post { - always { - script { - withCredentials([string(credentialsId: 'mailing-list-notification', variable: 'EMAIL_ADDRESSES')]) { - today = sh( - script: 'date +%D', - returnStdout: true - ).trim() - emailext attachLog: true, - to: EMAIL_ADDRESSES, - recipientProviders: [requestor()], - subject: "[Carbonio-Mailbox] Jenkins nightly report for ${today}", - body: """ -

-Hello,
-this is your daily report for nightly tests.
-You can find your report at the following link.
-The current build status is ${currentBuild.currentResult}.
-The build took ${currentBuild.durationString}.
-

-

-It is strongly suggested to save possible build/test failures because the build log could be pruned in the future. -

- -Have a nice day,
-
---
-Jenkins -""" - } - } - } - } -}