diff --git a/CHANGELOG.md b/CHANGELOG.md index a03112920d..b5c786457f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Prepare ThermalStorageTestData for Storage without storageVolumeLvlMin [#894](https://github.com/ie3-institute/simona/issues/894) - Renamed `ActivityStartTrigger`, `ScheduleTriggerMessage`, `CompletionMessage` in UML Diagrams[#675](https://github.com/ie3-institute/simona/issues/675) - Simplifying quantity integration in QuantityUtil [#973](https://github.com/ie3-institute/simona/issues/973) +- Reorganized Jenkins pipeline to separate build and test stages for better efficiency [#938](https://github.com/ie3-institute/simona/issues/938) ### Fixed - Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658) diff --git a/Jenkinsfile b/Jenkinsfile index 46e3837dd8..f8320f0960 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -101,31 +101,32 @@ node { } } + // Build the project + stage('build') { + gradle('clean assemble', projectName) + } + // test the project stage('run tests') { sh 'java -version' - gradle('--refresh-dependencies clean spotlessCheck pmdMain pmdTest reportScoverage checkScoverage', projectName) + gradle('--refresh-dependencies spotlessCheck pmdMain pmdTest', projectName) sh(script: """set +x && cd $projectName""" + ''' set +x; ./gradlew javadoc''', returnStdout: true) } - // sonarqube analysis - stage('sonarqube analysis') { + // sonarqube analysis & quality gate + stage('sonarqube') { String sonarqubeCurrentBranchName = prFromFork() ? prJsonObj.head.repo.full_name : currentBranchName // forks needs to be handled differently String sonarqubeCmd = determineSonarqubeGradleCmd(sonarqubeProjectKey, sonarqubeCurrentBranchName, targetBranchName, orgName, projectName, projectName) withSonarQubeEnv() { // will pick the global server connection from jenkins for sonarqube gradle(sonarqubeCmd, projectName) } - } - - // sonarqube quality gate - stage("quality gate") { timeout(time: 1, unit: 'HOURS') { - // just in case something goes wrong, pipeline will be killed after a timeout - def qg = waitForQualityGate() // reuse taskId previously collected by withSonarQubeEnv + // Just in case something goes wrong, pipeline will be killed after a timeout + def qg = waitForQualityGate() // Reuse taskId previously collected by withSonarQubeEnv if (qg.status != 'OK') { error "Pipeline aborted due to quality gate failure: ${qg.status}" } @@ -684,4 +685,4 @@ def getBranchType(String branchName) { } else { return null } -} \ No newline at end of file +}