Skip to content

Commit

Permalink
Merge pull request #978 from ie3-institute/ps/#938-ReorganizePipeline
Browse files Browse the repository at this point in the history
Reorganizing pipeline stages
  • Loading branch information
sebastian-peter authored Oct 2, 2024
2 parents 6c75d5c + c214437 commit 14e2284
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 11 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
Expand Down Expand Up @@ -684,4 +685,4 @@ def getBranchType(String branchName) {
} else {
return null
}
}
}

0 comments on commit 14e2284

Please sign in to comment.