-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
- Loading branch information
1 parent
bb47699
commit 222a71f
Showing
1 changed file
with
39 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,41 @@ | ||
pipeline { | ||
agent any | ||
tools { | ||
maven 'apache-maven-latest' | ||
jdk 'temurin-jdk11-latest' | ||
} | ||
stages { | ||
stage('Build') { | ||
steps { | ||
sh ''' | ||
java -version | ||
mvn -v | ||
''' | ||
} | ||
} | ||
} | ||
post { | ||
// send a mail on unsuccessful and fixed builds | ||
unsuccessful { // means unstable || failure || aborted | ||
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER!', | ||
body: '''Check console output at $BUILD_URL to view the results.''', | ||
recipientProviders: [culprits(), requestor()], | ||
to: 'andrew+ham@berezovskyi.me' | ||
} | ||
fixed { // back to normal | ||
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER!', | ||
body: '''Check console output at $BUILD_URL to view the results.''', | ||
recipientProviders: [culprits(), requestor()], | ||
to: 'andrew+ham@berezovskyi.me' | ||
} | ||
} | ||
agent any | ||
tools { | ||
maven 'apache-maven-latest' | ||
jdk 'temurin-jdk11-latest' | ||
} | ||
stages { | ||
stage('Build') { | ||
steps { | ||
sh ''' | ||
java -version | ||
mvn -v | ||
''' | ||
} | ||
} | ||
stage('Sonar') { | ||
withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SONARCLOUD_TOKEN')]) { | ||
withSonarQubeEnv('SonarCloud.io') { | ||
mvn clean verify -B sonar:sonar | ||
-Dsonar.projectKey=org.eclipse.lyo -Dsonar.organization=eclipse | ||
-Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONARCLOUD_TOKEN} | ||
} | ||
} | ||
} | ||
} | ||
post { | ||
// send a mail on unsuccessful and fixed builds | ||
unsuccessful { // means unstable || failure || aborted | ||
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER!', | ||
body: '''Check console output at $BUILD_URL to view the results.''', | ||
recipientProviders: [culprits(), requestor()], | ||
to: 'andrew+ham@berezovskyi.me' | ||
} | ||
fixed { // back to normal | ||
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER!', | ||
body: '''Check console output at $BUILD_URL to view the results.''', | ||
recipientProviders: [culprits(), requestor()], | ||
to: 'andrew+ham@berezovskyi.me' | ||
} | ||
} | ||
} |