Skip to content

Commit

Permalink
Merge branch 'dev' into ps/#939-GitHubActionsPipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippSchmelter authored Oct 2, 2024
2 parents 0e57156 + 14e2284 commit 5ff88ec
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 5ff88ec

Please sign in to comment.