Restore stage separated Jenkinsfile (#8272)

* Restore stage separated Jenkinsfile

* add -Dmaven.test.failure.ignore=true

* change -f jetty-home to -pl :jetty-home

* update script ci.sh with -pl :jetty-home

Co-authored-by: Olivier Lamy <oliver.lamy@gmail.com>
This commit is contained in:
Joakim Erdfelt 2022-07-08 04:06:04 -05:00 committed by GitHub
parent c53bc0709c
commit 1031bf1374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 155 additions and 28 deletions

161
Jenkinsfile vendored
View File

@ -1,5 +1,11 @@
#!groovy
/**
* IMPORTANT: Changes here need to be reflected in 2 other files as well.
* pom.xml
* build/scripts/ci.sh
*/
pipeline {
agent {
node { label 'linux' }
@ -7,37 +13,140 @@ pipeline {
// save some io during the build
options { durabilityHint('PERFORMANCE_OPTIMIZED') }
stages {
stage("Parallel Stage") {
parallel {
stage("Build / Test - JDK17") {
agent { node { label 'linux' } }
stage("Checkout Jetty") {
steps {
container('jetty-build') {
dir("${env.WORKSPACE}/buildy") {
checkout scm
}
}
}
}
stage("Build & Test - JDK17") {
stages {
stage("Setup") {
steps {
container('jetty-build') {
timeout( time: 180, unit: 'MINUTES' ) {
mavenBuild( "jdk17", "clean install -Perrorprone -Dmaven.test.failure.ignore=true", "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/**' +
// ',**/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()]
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
echo "Install org.eclipse.jetty:build-resources"
mavenBuild("jdk17", "clean install -f build", "maven3")
echo "Install org.eclipse.jetty:jetty-project"
mavenBuild("jdk17", "-N clean install", "maven3")
}
}
}
}
}
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 install -f jetty-integrations", "maven3")
}
}
}
}
}
stage("Module : /jetty-ee10/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
//cleanup all projects
mavenBuild("jdk17", "clean install -f jetty-ee10", "maven3")
}
}
}
}
}
stage("Module : /jetty-ee9/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
//cleanup all projects
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 install -f jetty-ee8", "maven3")
}
}
}
}
}
stage("Module : /jetty-home/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
//cleanup all projects
mavenBuild("jdk17", "clean install -pl :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 install -f tests", "maven3")
}
}
}
}
}
/*
stage("Module : /jetty-p2/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
mavenBuild("jdk17", "clean install -f jetty-p2", "maven3")
}
}
}
}
}
*/
/*
stage("Module : /documentation/") {
steps {
container('jetty-build') {
timeout(time: 120, unit: 'MINUTES') {
dir("${env.WORKSPACE}/buildy") {
mavenBuild("jdk17", "clean install -f documentation", "maven3")
}
}
}
}
}
*/
}
}
}
@ -60,7 +169,7 @@ def mavenBuild(jdk, cmdline, mvnName) {
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
configFileProvider(
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
sh "mvn --no-transfer-progress -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -Djetty.testtracker.log=true $cmdline"
sh "mvn --no-transfer-progress -Dmaven.test.failure.ignore=true -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -Djetty.testtracker.log=true $cmdline"
}
}
}

16
build/scripts/ci.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# Represents the command line version of the CI build in Jenkinsfile
mvn clean install -f build
mvn clean install -N
mvn clean install -f jetty-core
mvn clean install -f jetty-integrations
mvn clean install -f jetty-ee10
mvn clean install -f jetty-ee9
mvn clean install -f jetty-ee8
mvn clean install -pl :jetty-home
mvn clean install -f tests
# mvn clean install -f jetty-p2
# mvn clean install -f documentation

View File

@ -182,16 +182,18 @@
</pluginRepositories>
<modules>
<!-- CAUTION: Any changes to this list will need to be represented
in the Jenkinsfile and build/scripts/ci.sh as well -->
<module>build</module>
<!-- <module>documentation</module>-->
<module>jetty-core</module>
<module>jetty-integrations</module>
<module>jetty-ee8</module>
<module>jetty-ee9</module>
<module>jetty-ee10</module>
<module>jetty-home</module>
<!-- <module>jetty-p2</module>-->
<module>tests</module>
<!-- <module>jetty-p2</module> -->
<!-- <module>documentation</module> -->
</modules>
<build>