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 {
|
|
|
|
agent any
|
2018-12-31 21:37:24 -05:00
|
|
|
// save some io during the build
|
|
|
|
options { durabilityHint('PERFORMANCE_OPTIMIZED') }
|
2018-11-12 11:12:15 -05:00
|
|
|
stages {
|
|
|
|
stage("Parallel Stage") {
|
|
|
|
parallel {
|
|
|
|
stage("Build / Test - JDK8") {
|
|
|
|
agent { node { label 'linux' } }
|
|
|
|
steps {
|
2020-05-07 17:29:56 -04:00
|
|
|
container('jetty-build') {
|
2020-11-25 16:29:29 -05:00
|
|
|
timeout( time: 240, unit: 'MINUTES' ) {
|
2020-12-10 20:47:26 -05:00
|
|
|
mavenBuild( "jdk8", "clean install", "maven3")
|
2020-05-07 17:29:56 -04:00
|
|
|
// 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/**' +
|
|
|
|
',**/org/eclipse/jetty/jspc/**' +
|
|
|
|
// 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/spring/**' +
|
|
|
|
',**/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'
|
2020-12-10 20:47:26 -05:00
|
|
|
recordIssues id: "jdk8", name: "Static Analysis jdk8", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser()]
|
2020-05-07 17:29:56 -04:00
|
|
|
}
|
2019-08-14 06:30:54 -04:00
|
|
|
}
|
2018-01-31 23:29:08 -05:00
|
|
|
}
|
2018-01-31 20:24:31 -05:00
|
|
|
}
|
2016-07-26 10:25:23 -04:00
|
|
|
|
2018-11-12 11:12:15 -05:00
|
|
|
stage("Build / Test - JDK11") {
|
|
|
|
agent { node { label 'linux' } }
|
|
|
|
steps {
|
2020-05-07 17:29:56 -04:00
|
|
|
container( 'jetty-build' ) {
|
2020-11-25 16:29:29 -05:00
|
|
|
timeout( time: 240, unit: 'MINUTES' ) {
|
2020-12-10 20:47:26 -05:00
|
|
|
mavenBuild( "jdk11", "clean install -Djacoco.skip=true -Perrorprone", "maven3")
|
|
|
|
recordIssues id: "jdk11", name: "Static Analysis jdk11", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser(), errorProne()]
|
2020-05-07 17:29:56 -04:00
|
|
|
}
|
2019-08-14 06:30:54 -04:00
|
|
|
}
|
2019-02-26 21:37:21 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-18 00:19:28 -04:00
|
|
|
stage("Build / Test - JDK15") {
|
2019-09-23 11:30:35 -04:00
|
|
|
agent { node { label 'linux' } }
|
|
|
|
steps {
|
2020-05-07 17:29:56 -04:00
|
|
|
container( 'jetty-build' ) {
|
2020-11-25 16:29:29 -05:00
|
|
|
timeout( time: 240, unit: 'MINUTES' ) {
|
2020-12-10 20:47:26 -05:00
|
|
|
mavenBuild( "jdk15", "clean install -Djacoco.skip=true", "maven3")
|
|
|
|
recordIssues id: "jdk15", name: "Static Analysis jdk15", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser()]
|
2020-05-07 17:29:56 -04:00
|
|
|
}
|
2019-09-23 11:30:35 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-12 11:12:15 -05:00
|
|
|
stage("Build Javadoc") {
|
|
|
|
agent { node { label 'linux' } }
|
|
|
|
steps {
|
2020-05-07 17:29:56 -04:00
|
|
|
container( 'jetty-build' ) {
|
2020-12-10 20:47:26 -05:00
|
|
|
timeout( time: 120, unit: 'MINUTES' ) {
|
2020-05-07 17:29:56 -04:00
|
|
|
mavenBuild( "jdk11",
|
|
|
|
"install javadoc:javadoc javadoc:aggregate-jar -DskipTests -Dpmd.skip=true -Dcheckstyle.skip=true",
|
2020-12-10 20:47:26 -05:00
|
|
|
"maven3")
|
|
|
|
recordIssues id: "javadoc", enabledForFailure: true, tools: [javaDoc()]
|
2020-05-07 17:29:56 -04:00
|
|
|
}
|
2019-08-14 06:30:54 -04:00
|
|
|
}
|
2018-11-12 11:12:15 -05:00
|
|
|
}
|
|
|
|
}
|
2018-01-31 20:48:13 -05:00
|
|
|
|
2018-11-12 11:12:15 -05:00
|
|
|
stage("Build Compact3") {
|
|
|
|
agent { node { label 'linux' } }
|
|
|
|
steps {
|
2020-05-07 17:29:56 -04:00
|
|
|
container( 'jetty-build' ) {
|
2020-12-10 20:47:26 -05:00
|
|
|
timeout( time: 120, unit: 'MINUTES' ) {
|
|
|
|
mavenBuild( "jdk8", "-Pcompact3 clean install -DskipTests", "maven3")
|
2020-05-07 17:29:56 -04:00
|
|
|
}
|
2019-08-14 06:30:54 -04:00
|
|
|
}
|
2018-11-12 11:12:15 -05:00
|
|
|
}
|
2018-11-01 11:13:16 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-01-31 20:48:13 -05:00
|
|
|
}
|
2019-05-30 06:15:29 -04:00
|
|
|
post {
|
|
|
|
failure {
|
|
|
|
slackNotif()
|
|
|
|
}
|
|
|
|
unstable {
|
|
|
|
slackNotif()
|
|
|
|
}
|
|
|
|
fixed {
|
|
|
|
slackNotif()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def slackNotif() {
|
2019-05-31 00:24:13 -04:00
|
|
|
script {
|
2019-06-28 04:04:43 -04:00
|
|
|
try
|
|
|
|
{
|
|
|
|
if ( env.BRANCH_NAME == 'jetty-10.0.x' || env.BRANCH_NAME == 'jetty-9.4.x' )
|
|
|
|
{
|
2019-05-31 00:24:13 -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',
|
2019-06-28 04:04:43 -04:00
|
|
|
color: COLOR_MAP[currentBuild.currentResult],
|
|
|
|
message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} - ${env.BUILD_URL}"
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace()
|
|
|
|
echo "skip failure slack notification: " + e.getMessage()
|
2019-05-30 06:34:42 -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.
|
2020-10-27 22:07:49 -04:00
|
|
|
* @param consoleParsers array of console parsers to run
|
2018-11-13 08:24:29 -05:00
|
|
|
*/
|
2020-12-10 20:47:26 -05:00
|
|
|
def mavenBuild(jdk, cmdline, mvnName) {
|
2020-09-10 23:11:04 -04:00
|
|
|
script {
|
|
|
|
try {
|
|
|
|
withEnv(["JAVA_HOME=${ tool "$jdk" }",
|
|
|
|
"PATH+MAVEN=${env.JAVA_HOME}/bin:${tool "$mvnName"}/bin",
|
|
|
|
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
|
2020-09-16 03:42:48 -04:00
|
|
|
configFileProvider(
|
|
|
|
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
|
2020-12-10 20:47:26 -05:00
|
|
|
sh "mvn --no-transfer-progress -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -Djetty.testtracker.log=true $cmdline -Dunix.socket.tmp=/tmp/unixsocket"
|
2020-09-16 03:42:48 -04: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-09-10 23:11:04 -04:00
|
|
|
}
|
2018-11-12 11:12:15 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-22 06:53:46 -04:00
|
|
|
|
2018-11-27 19:12:07 -05:00
|
|
|
// vim: et:ts=2:sw=2:ft=groovy
|