2018-01-31 20:44:55 -05:00
|
|
|
#!groovy
|
2018-01-31 20:46:35 -05:00
|
|
|
|
2018-11-12 11:12:15 -05:00
|
|
|
pipeline {
|
2023-01-22 20:44:31 -05:00
|
|
|
agent none
|
2019-02-21 09:45:12 -05:00
|
|
|
// save some io during the build
|
2022-06-30 21:49:32 -04:00
|
|
|
options {
|
|
|
|
skipDefaultCheckout()
|
|
|
|
durabilityHint('PERFORMANCE_OPTIMIZED')
|
2022-10-28 20:07:55 -04:00
|
|
|
buildDiscarder logRotator( numToKeepStr: '60' )
|
2022-06-30 21:49:32 -04:00
|
|
|
}
|
2019-02-21 09:45:12 -05:00
|
|
|
stages {
|
2020-11-18 06:26:38 -05:00
|
|
|
stage("Parallel Stage") {
|
2019-02-21 09:45:12 -05:00
|
|
|
parallel {
|
2023-09-28 17:19:36 -04:00
|
|
|
stage("Build / Test - JDK21") {
|
2022-12-01 11:56:34 -05:00
|
|
|
agent { node { label 'linux' } }
|
|
|
|
steps {
|
|
|
|
timeout( time: 180, unit: 'MINUTES' ) {
|
|
|
|
checkout scm
|
2023-09-28 17:19:36 -04:00
|
|
|
mavenBuild( "jdk21", "clean install -Dspotbugs.skip=true -Djacoco.skip=true", "maven3")
|
|
|
|
recordIssues id: "jdk21", name: "Static Analysis jdk21", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle()]
|
2022-12-01 11:56:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-11 15:56:38 -05:00
|
|
|
stage("Build / Test - JDK17") {
|
2021-11-09 07:02:58 -05:00
|
|
|
agent { node { label 'linux' } }
|
|
|
|
steps {
|
2022-11-02 02:13:34 -04:00
|
|
|
timeout( time: 180, unit: 'MINUTES' ) {
|
|
|
|
checkout scm
|
|
|
|
mavenBuild( "jdk17", "clean install -Perrorprone", "maven3")
|
|
|
|
// Collect up the jacoco execution results (only on main build)
|
|
|
|
jacoco inclusionPattern: '**/org/eclipse/jetty/**/*.class',
|
|
|
|
exclusionPattern: '' +
|
|
|
|
// build tools
|
|
|
|
'**/org/eclipse/jetty/ant/**' +
|
|
|
|
',*/org/eclipse/jetty/maven/its/**' +
|
|
|
|
',**/org/eclipse/jetty/its/**' +
|
|
|
|
// example code / documentation
|
|
|
|
',**/org/eclipse/jetty/embedded/**' +
|
|
|
|
',**/org/eclipse/jetty/asyncrest/**' +
|
|
|
|
',**/org/eclipse/jetty/demo/**' +
|
|
|
|
// special environments / late integrations
|
|
|
|
',**/org/eclipse/jetty/gcloud/**' +
|
|
|
|
',**/org/eclipse/jetty/infinispan/**' +
|
|
|
|
',**/org/eclipse/jetty/osgi/**' +
|
|
|
|
',**/org/eclipse/jetty/http/spi/**' +
|
|
|
|
// test classes
|
|
|
|
',**/org/eclipse/jetty/tests/**' +
|
|
|
|
',**/org/eclipse/jetty/test/**',
|
|
|
|
execPattern: '**/target/jacoco.exec',
|
|
|
|
classPattern: '**/target/classes',
|
|
|
|
sourcePattern: '**/src/main/java'
|
|
|
|
recordIssues id: "jdk17", name: "Static Analysis jdk17", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), errorProne(), spotBugs()]
|
2021-11-09 07:02:58 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-02-26 21:37:21 -05:00
|
|
|
|
2022-02-11 15:56:38 -05:00
|
|
|
stage("Build / Test - JDK11") {
|
2021-07-21 16:51:50 -04:00
|
|
|
agent { node { label 'linux' } }
|
|
|
|
steps {
|
2022-11-02 02:13:34 -04:00
|
|
|
timeout( time: 180, unit: 'MINUTES' ) {
|
|
|
|
checkout scm
|
|
|
|
mavenBuild( "jdk11", "clean install -Dspotbugs.skip=true -Djacoco.skip=true", "maven3")
|
|
|
|
recordIssues id: "jdk11", name: "Static Analysis jdk11", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle()]
|
2021-07-21 16:51:50 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-21 12:01:26 -05:00
|
|
|
}
|
2018-11-01 11:13:16 -04:00
|
|
|
}
|
2020-05-07 20:30:36 -04:00
|
|
|
}
|
|
|
|
post {
|
|
|
|
failure {
|
|
|
|
slackNotif()
|
|
|
|
}
|
|
|
|
unstable {
|
|
|
|
slackNotif()
|
|
|
|
}
|
|
|
|
fixed {
|
|
|
|
slackNotif()
|
2024-09-03 22:50:56 -04:00
|
|
|
websiteBuild()
|
|
|
|
}
|
|
|
|
success {
|
|
|
|
websiteBuild()
|
2019-05-30 06:15:29 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-05-07 20:26:15 -04:00
|
|
|
|
2019-05-30 06:15:29 -04:00
|
|
|
def slackNotif() {
|
2019-08-14 10:39:06 -04:00
|
|
|
script {
|
|
|
|
try {
|
2020-11-23 18:42:14 -05:00
|
|
|
if ( env.BRANCH_NAME == 'jetty-10.0.x' || env.BRANCH_NAME == 'jetty-11.0.x') {
|
2019-08-14 10:39:06 -04:00
|
|
|
//BUILD_USER = currentBuild.rawBuild.getCause(Cause.UserIdCause).getUserId()
|
|
|
|
// by ${BUILD_USER}
|
|
|
|
COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger']
|
|
|
|
slackSend channel: '#jenkins',
|
2020-11-18 06:26:38 -05:00
|
|
|
color: COLOR_MAP[currentBuild.currentResult],
|
|
|
|
message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} - ${env.BUILD_URL}"
|
2019-05-30 06:34:42 -04:00
|
|
|
}
|
2019-08-14 10:39:06 -04:00
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace()
|
|
|
|
echo "skip failure slack notification: " + e.getMessage()
|
2019-05-30 06:34:42 -04:00
|
|
|
}
|
2019-08-14 10:39:06 -04:00
|
|
|
}
|
2018-01-31 20:24:31 -05:00
|
|
|
}
|
2019-06-28 04:04:43 -04:00
|
|
|
|
2018-11-13 08:24:29 -05:00
|
|
|
/**
|
|
|
|
* To other developers, if you are using this method above, please use the following syntax.
|
|
|
|
*
|
|
|
|
* mavenBuild("<jdk>", "<profiles> <goals> <plugins> <properties>"
|
|
|
|
*
|
|
|
|
* @param jdk the jdk tool name (in jenkins) to use for this build
|
|
|
|
* @param cmdline the command line in "<profiles> <goals> <properties>"`format.
|
|
|
|
* @return the Jenkinsfile step representing a maven build
|
|
|
|
*/
|
2020-12-10 20:47:26 -05:00
|
|
|
def mavenBuild(jdk, cmdline, mvnName) {
|
2020-11-18 06:26:38 -05:00
|
|
|
script {
|
|
|
|
try {
|
|
|
|
withEnv(["JAVA_HOME=${ tool "$jdk" }",
|
|
|
|
"PATH+MAVEN=${ tool "$jdk" }/bin:${tool "$mvnName"}/bin",
|
|
|
|
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
|
|
|
|
configFileProvider(
|
|
|
|
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
|
2023-03-01 14:08:51 -05:00
|
|
|
sh "mvn -Dmaven.repo.uri=http://10.0.0.15:8081/repository/maven-public/ -ntp -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e $cmdline"
|
2020-11-18 06:26:38 -05:00
|
|
|
}
|
|
|
|
}
|
2020-09-10 23:11:04 -04:00
|
|
|
}
|
|
|
|
finally
|
|
|
|
{
|
2020-11-10 19:54:07 -05:00
|
|
|
junit testResults: '**/target/surefire-reports/*.xml,**/target/invoker-reports/TEST*.xml', allowEmptyResults: true
|
2020-11-18 06:26:38 -05:00
|
|
|
}
|
2019-02-21 09:45:12 -05:00
|
|
|
}
|
2018-01-31 20:48:13 -05:00
|
|
|
}
|
2016-07-26 10:25:23 -04:00
|
|
|
|
2024-09-03 22:50:56 -04:00
|
|
|
def websiteBuild() {
|
|
|
|
script {
|
|
|
|
try {
|
|
|
|
if (env.BRANCH_NAME == 'jetty-10.0.x' || env.BRANCH_NAME == 'jetty-11.0.x' || env.BRANCH_NAME == 'jetty-12.0.x') {
|
|
|
|
build(job: 'website/jetty.website/main', propagate: false, wait: false)
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace()
|
|
|
|
echo "skip website build triggering: " + e.getMessage()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-27 19:12:07 -05:00
|
|
|
// vim: et:ts=2:sw=2:ft=groovy
|