jetty.project/Jenkinsfile

193 lines
7.5 KiB
Plaintext
Raw Normal View History

#!groovy
pipeline {
agent none
// save some io during the build
2022-07-10 21:28:34 -04:00
options {
skipDefaultCheckout()
durabilityHint('PERFORMANCE_OPTIMIZED')
buildDiscarder logRotator( numToKeepStr: '60' )
disableRestartFromStage()
2022-07-10 21:28:34 -04:00
}
environment {
LAUNCHABLE_TOKEN = credentials('launchable-token')
}
stages {
stage("Parallel Stage") {
parallel {
stage("Build / Test - JDK21") {
agent { node { label 'linux' } }
steps {
timeout( time: 180, unit: 'MINUTES' ) {
checkout scm
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(), javaDoc()],
skipPublishingChecks: true, skipBlames: true
}
}
}
stage("Build / Test - JDK22") {
agent { node { label 'linux' } }
steps {
timeout( time: 180, unit: 'MINUTES' ) {
checkout scm
mavenBuild( "jdk22", "clean install -Dspotbugs.skip=true -Djacoco.skip=true", "maven3")
recordIssues id: "jdk22", name: "Static Analysis jdk22", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), javaDoc()]
}
}
}
stage("Build / Test - JDK17") {
agent { node { label 'linux' } }
steps {
timeout( time: 180, unit: 'MINUTES' ) {
checkout scm
mavenBuild( "jdk17", "clean install -Perrorprone", "maven3") // javadoc:javadoc
recordIssues id: "analysis-jdk17", name: "Static Analysis jdk17", aggregatingResults: true, enabledForFailure: true,
tools: [mavenConsole(), java(), checkStyle(), errorProne(), spotBugs(), javaDoc()],
skipPublishingChecks: true, skipBlames: true
recordCoverage id: "coverage-jdk17", name: "Coverage jdk17", tools: [[parser: 'JACOCO']], sourceCodeRetention: 'MODIFIED',
sourceDirectories: [[path: 'src/main/java'], [path: 'target/generated-sources/ee8']]
}
}
}
}
}
}
post {
failure {
slackNotif()
}
unstable {
slackNotif()
}
fixed {
slackNotif()
websiteBuild()
}
success {
websiteBuild()
}
}
}
def slackNotif() {
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_USER = currentBuild.rawBuild.getCause(Cause.UserIdCause).getUserId()
// by ${BUILD_USER}
COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger']
slackSend channel: '#jenkins',
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()
}
}
}
/**
* 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
*/
Jetty 9.4.x optimize parser warning from logs and add spotbug (#5735) * enable spotbugs in CI Signed-off-by: olivier lamy <oliver.lamy@gmail.com> record issues Signed-off-by: olivier lamy <oliver.lamy@gmail.com> use warning new generation Signed-off-by: olivier lamy <oliver.lamy@gmail.com> activate errorprone Signed-off-by: olivier lamy <oliver.lamy@gmail.com> fix Jenkinsfile Signed-off-by: olivier lamy <oliver.lamy@gmail.com> do not run spotbugs for jetty-runner as we do not want to fix all dependencies bugs :) Signed-off-by: olivier lamy <oliver.lamy@gmail.com> junit should allow empty results Signed-off-by: olivier lamy <oliver.lamy@gmail.com> maven console can be use only once... Signed-off-by: olivier lamy <oliver.lamy@gmail.com> one liner Signed-off-by: olivier lamy <oliver.lamy@gmail.com> recordissues only once Signed-off-by: olivier lamy <oliver.lamy@gmail.com> force id Signed-off-by: olivier lamy <oliver.lamy@gmail.com> aggregate results Signed-off-by: olivier lamy <oliver.lamy@gmail.com> configure a name for aggregated reports Signed-off-by: olivier lamy <oliver.lamy@gmail.com> mo more -T3 no need anymore of remote session test profile Signed-off-by: olivier lamy <oliver.lamy@gmail.com> I want to see what failing tests look like with new report. Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com> skip spotbugs for jetty-jmh Signed-off-by: olivier lamy <oliver.lamy@gmail.com> get rid of findbugs as we now have spotbugs Signed-off-by: olivier lamy <oliver.lamy@gmail.com> Revert "I want to see what failing tests look like with new report." This reverts commit df0d13e4c53d7461872e1f925ec06bd36e4a66c9. activate errorProne parser Signed-off-by: olivier lamy <oliver.lamy@gmail.com> make pmd quiet for CI Signed-off-by: olivier lamy <oliver.lamy@gmail.com> remove -fae flag and do not display transfer progress Signed-off-by: olivier lamy <oliver.lamy@gmail.com> try junitParser() to see what it does Signed-off-by: olivier lamy <oliver.lamy@gmail.com> junit parser is a bad idea... Signed-off-by: olivier lamy <oliver.lamy@gmail.com> increase timeout Signed-off-by: olivier lamy <oliver.lamy@gmail.com> no -T2 for javadoc Signed-off-by: olivier lamy <oliver.lamy@gmail.com> fix skip spotbugs and pmd verbose Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * remove -T options Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-12-10 20:47:26 -05:00
def mavenBuild(jdk, cmdline, mvnName) {
2022-06-29 18:11:49 -04:00
script {
Jetty 10.0.x surefire upgrade and no skip errors (#5438) * fix apacheds version Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * get some logs Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * more debug Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * testing surefire M5 Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * already part of the classpath Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * add slf4j-simple to get logs Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * execute full build Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * no need to add jmx module Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * use h2spec-reports Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * h2 spec tests are too flaky Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * debug Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * touch trigger build Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * not trim stacktrace per default and a bit more memory for test Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * disable embedded jmx test Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * nit Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * no junit files for javadoc Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fix dependency version Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fix missing dependency with surefire M5... Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * remove debug Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fix some upperbound dependency Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fail quickly Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-11-18 06:26:38 -05:00
try {
withEnv(["JAVA_HOME=${ tool "$jdk" }",
"PATH+MAVEN=${ tool "$jdk" }/bin:${tool "$mvnName"}/bin",
"MAVEN_OPTS=-Xms3072m -Xmx5120m -Djava.awt.headless=true -client -XX:+UnlockDiagnosticVMOptions -XX:GCLockerRetryAllocationCount=100"]) {
configFileProvider(
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS'),
configFile(fileId: 'maven-build-cache-config.xml', variable: 'MVN_BUILD_CACHE_CONFIG')]) {
//sh "cp $MVN_BUILD_CACHE_CONFIG .mvn/maven-build-cache-config.xml"
//-Dmaven.build.cache.configPath=$MVN_BUILD_CACHE_CONFIG
buildCache = useBuildCache()
if (buildCache) {
echo "Using build cache"
extraArgs = " -Dmaven.build.cache.restoreGeneratedSources=false -Dmaven.build.cache.remote.url=http://nginx-cache-service.jenkins.svc.cluster.local:80 -Dmaven.build.cache.remote.enabled=true -Dmaven.build.cache.remote.save.enabled=true -Dmaven.build.cache.remote.server.id=remote-build-cache-server -Daether.connector.http.supportWebDav=true "
} else {
// when not using cache
echo "Not using build cache"
extraArgs = " -Dmaven.test.failure.ignore=true -Dmaven.build.cache.skipCache=true -Dmaven.build.cache.remote.url=http://nginx-cache-service.jenkins.svc.cluster.local:80 -Dmaven.build.cache.remote.enabled=true -Dmaven.build.cache.remote.save.enabled=true -Dmaven.build.cache.remote.server.id=remote-build-cache-server -Daether.connector.http.supportWebDav=true "
}
if (env.BRANCH_NAME ==~ /PR-\d+/) {
if (pullRequest.labels.contains("build-all-tests")) {
extraArgs = " -Dmaven.test.failure.ignore=true "
}
}
runLaunchable ("verify")
runLaunchable ("record build --name jetty-12.0.x")
sh "mvn $extraArgs -DsettingsPath=$GLOBAL_MVN_SETTINGS -Dmaven.repo.uri=http://nexus-service.nexus.svc.cluster.local:8081/repository/maven-public/ -ntp -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -U $cmdline"
if(saveHome()) {
archiveArtifacts artifacts: ".repository/org/eclipse/jetty/jetty-home/**/jetty-home-*", allowEmptyArchive: true, onlyIfSuccessful: false
}
Jetty 10.0.x surefire upgrade and no skip errors (#5438) * fix apacheds version Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * get some logs Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * more debug Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * testing surefire M5 Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * already part of the classpath Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * add slf4j-simple to get logs Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * execute full build Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * no need to add jmx module Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * use h2spec-reports Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * h2 spec tests are too flaky Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * debug Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * touch trigger build Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * not trim stacktrace per default and a bit more memory for test Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * disable embedded jmx test Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * nit Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * no junit files for javadoc Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fix dependency version Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fix missing dependency with surefire M5... Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * remove debug Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fix some upperbound dependency Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fail quickly Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-11-18 06:26:38 -05:00
}
}
Jetty 9.4.x not skipping tests failure and fix jaas test (#5255) * remove -Dmaven.test.failure.ignore=true Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * get JAASLdapLoginServiceTest working Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * increase memory Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * use only single thread to have more readable log in Jenkins Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * disable java8 Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * test only java8 Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * increase memory Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * try -T3 Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * restore jdk11/14 Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * try more memory Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * archive logs from Jenkins Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * archive logs from Jenkins Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * more memory Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * skip jacoco Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * test useManifestOnlyJar true Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * junit Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * useManifestOnlyJar false Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * debug maven surefire Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * very simple build to debug Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * try M5 Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * try not using withMaven Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * no debug surefire M4 Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * all jdk and M5 Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * enable jacoco only for java8 Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * reduce memory usage for test Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * avoid duplications of warnings parsing Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fix my bad Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-09-10 23:11:04 -04:00
}
finally
{
junit testDataPublishers: [[$class: 'JUnitFlakyTestDataPublisher']], testResults: '**/target/surefire-reports/**/*.xml,**/target/invoker-reports/TEST*.xml', allowEmptyResults: true
echo "Launchable record tests"
runLaunchable ("record tests --build jetty-12.0.x maven '**/target/surefire-reports/**/*.xml' '**/target/invoker-reports/TEST*.xml'")
Jetty 10.0.x surefire upgrade and no skip errors (#5438) * fix apacheds version Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * get some logs Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * more debug Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * testing surefire M5 Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * already part of the classpath Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * add slf4j-simple to get logs Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * execute full build Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * no need to add jmx module Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * use h2spec-reports Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * h2 spec tests are too flaky Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * debug Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * touch trigger build Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * not trim stacktrace per default and a bit more memory for test Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * disable embedded jmx test Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * nit Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * no junit files for javadoc Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fix dependency version Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fix missing dependency with surefire M5... Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * remove debug Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fix some upperbound dependency Signed-off-by: olivier lamy <oliver.lamy@gmail.com> * fail quickly Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-11-18 06:26:38 -05:00
}
2022-06-29 18:11:49 -04:00
}
}
2016-07-26 10:25:23 -04:00
/**
* calculate to use cache or not. per default will not run
*/
def useBuildCache() {
def labelNoBuildCache = false
if (env.BRANCH_NAME ==~ /PR-\d+/) {
labelNoBuildCache = pullRequest.labels.contains("build-no-cache")
}
def noBuildCache = (env.BRANCH_NAME == 'jetty-12.0.x') || labelNoBuildCache;
return !noBuildCache;
// want to skip build cache
// return false
}
def saveHome() {
if (env.BRANCH_NAME ==~ /PR-\d+/) {
return pullRequest.labels.contains("save-home")
}
return false;
}
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()
}
}
}
/**
* run launchable with args and ignore any errors
* @param args
*/
def runLaunchable(args) {
try {
sh "launchable $args"
} catch (Exception e) {
e.printStackTrace()
echo "skip failure running Launchable: " + e.getMessage()
}
}
// vim: et:ts=2:sw=2:ft=groovy