Go back to simpler Jenkinsfile (#8217)

This commit is contained in:
Joakim Erdfelt 2022-06-29 17:11:49 -05:00 committed by GitHub
parent c8e6bbdf1b
commit 5304233b15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 121 deletions

149
Jenkinsfile vendored
View File

@ -7,132 +7,37 @@ pipeline {
// save some io during the build // save some io during the build
options { durabilityHint('PERFORMANCE_OPTIMIZED') } options { durabilityHint('PERFORMANCE_OPTIMIZED') }
stages { stages {
stage("Checkout Jetty") { stage("Parallel Stage") {
steps { parallel {
container('jetty-build') { stage("Build / Test - JDK17") {
dir("${env.WORKSPACE}/buildy") { agent { node { label 'linux' } }
checkout scm
}
}
}
}
stage("Build & Test - JDK17") {
stages {
stage("Setup") {
steps { steps {
container('jetty-build') { container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') { timeout( time: 180, unit: 'MINUTES' ) {
dir("${env.WORKSPACE}/buildy") { mavenBuild( "jdk17", "clean install -Perrorprone", "maven3")
echo "Install org.eclipse.jetty:build-resources" // Collect up the jacoco execution results (only on main build)
mavenBuild("jdk17", "clean install -f build", "maven3") // jacoco inclusionPattern: '**/org/eclipse/jetty/**/*.class',
echo "Install org.eclipse.jetty:jetty-project" // exclusionPattern: '' +
mavenBuild("jdk17", "-N clean install", "maven3") // // 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/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()]
} }
} }
} }
} }
stage("Module : /jetty-core/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
mavenBuild("jdk17", "clean install -f jetty-core", "maven3")
}
}
}
}
}
stage("Module : /jetty-integrations/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
//cleanup all projects
mavenBuild("jdk17", "clean -T4", "maven3")
mavenBuild("jdk17", "clean install -f jetty-integrations", "maven3")
}
}
}
}
}
stage("Module : /jetty-ee9/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
//cleanup all projects
mavenBuild("jdk17", "clean -T4", "maven3")
mavenBuild("jdk17", "clean install -f jetty-ee9", "maven3")
}
}
}
}
}
stage("Module : /jetty-ee8/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
//cleanup all projects
mavenBuild("jdk17", "clean -T4", "maven3")
mavenBuild("jdk17", "clean install -f jetty-ee8", "maven3")
}
}
}
}
}
stage("Module : /jetty-ee10/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
//cleanup all projects
mavenBuild("jdk17", "clean -T4", "maven3")
mavenBuild("jdk17", "clean install -f jetty-ee10", "maven3")
}
}
}
}
}
/*stage("Module : /jetty-home/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
//cleanup all projects
mavenBuild("jdk17", "clean -T4", "maven3")
mavenBuild("jdk17", "clean install -f jetty-home", "maven3")
}
}
}
}
}*/
/*
stage("Module : /tests/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
//cleanup all projects
mavenBuild("jdk17", "clean -T4", "maven3")
mavenBuild("jdk17", "clean install -f tests", "maven3")
}
}
}
}
}*/
/*stage("Module : /documentation/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
mavenBuild("jdk17", "clean install -f documentation", "maven3")
}
}
}
}
}*/
} }
} }
} }
@ -148,13 +53,14 @@ pipeline {
* @return the Jenkinsfile step representing a maven build * @return the Jenkinsfile step representing a maven build
*/ */
def mavenBuild(jdk, cmdline, mvnName) { def mavenBuild(jdk, cmdline, mvnName) {
script {
try { try {
withEnv(["JAVA_HOME=${ tool "$jdk" }", withEnv(["JAVA_HOME=${ tool "$jdk" }",
"PATH+MAVEN=${ tool "$jdk" }/bin:${tool "$mvnName"}/bin", "PATH+MAVEN=${ tool "$jdk" }/bin:${tool "$mvnName"}/bin",
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) { "MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
configFileProvider( configFileProvider(
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) { [configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
sh "mvn --no-transfer-progress -s $GLOBAL_MVN_SETTINGS -Pci --show-version --batch-mode --errors -Djetty.testtracker.log=true -Dmaven.test.failure.ignore=true $cmdline" sh "mvn --no-transfer-progress -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -Djetty.testtracker.log=true $cmdline"
} }
} }
} }
@ -162,6 +68,7 @@ def mavenBuild(jdk, cmdline, mvnName) {
{ {
junit testResults: '**/target/surefire-reports/*.xml,**/target/invoker-reports/TEST*.xml', allowEmptyResults: true junit testResults: '**/target/surefire-reports/*.xml,**/target/invoker-reports/TEST*.xml', allowEmptyResults: true
} }
}
} }
// vim: et:ts=2:sw=2:ft=groovy // vim: et:ts=2:sw=2:ft=groovy