Skip to content

Commit

Permalink
Merge pull request #813 from apache/feature/jenkins-pipeline-struts-7
Browse files Browse the repository at this point in the history
Builds Struts 7 as part of the main pipeline
  • Loading branch information
lukaszlenart committed Dec 17, 2023
2 parents f450184 + 165e464 commit 4bc19c7
Showing 1 changed file with 78 additions and 3 deletions.
81 changes: 78 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,36 @@ pipeline {
}
}
}
stage('JDK 21') {
agent {
label 'ubuntu'
}
tools {
jdk 'jdk_21_latest'
maven 'maven_3_latest'
}
environment {
MAVEN_OPTS = "-Xmx1024m"
}
stages {
stage('Test') {
steps {
sh './mvnw -B -DskipAssembly verify --no-transfer-progress'
}
post {
always {
junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true)
junit(testResults: '**/failsafe-reports/*.xml', allowEmptyResults: true)
}
}
}
}
post {
always {
cleanWs deleteDirs: true, patterns: [[pattern: '**/target/**', type: 'INCLUDE']]
}
}
}
stage('JDK 17') {
agent {
label 'ubuntu'
Expand All @@ -39,7 +69,7 @@ pipeline {
stages {
stage('Build') {
steps {
sh './mvnw -B clean install -DskipTests -DskipAssembly'
sh './mvnw -B -DskipAssembly verify --no-transfer-progress'
}
}
stage('Test') {
Expand All @@ -55,14 +85,59 @@ pipeline {
}
stage('Code Quality') {
when {
branch 'master'
anyOf {
branch 'master'; branch 'release/struts-7-0-x'
}
}
steps {
withCredentials([string(credentialsId: 'asf-struts-sonarcloud', variable: 'SONARCLOUD_TOKEN')]) {
sh './mvnw -B -Pcoverage -DskipAssembly -Dsonar.login=${SONARCLOUD_TOKEN} verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar'
}
}
}
stage('Build Source & JavaDoc') {
when {
branch 'release/struts-7-0-x'
}
steps {
dir("local-snapshots-dir/") {
deleteDir()
}
sh './mvnw -B source:jar javadoc:jar -DskipTests -DskipAssembly'
}
}
stage('Deploy Snapshot') {
when {
branch 'release/struts-7-0-x'
}
steps {
withCredentials([file(credentialsId: 'lukaszlenart-repository-access-token', variable: 'CUSTOM_SETTINGS')]) {
sh './mvnw -s \${CUSTOM_SETTINGS} deploy -DskipTests -DskipAssembly'
}
}
}
stage('Upload nightlies') {
when {
branch 'release/struts-7-0-x'
}
steps {
sh './mvnw -B package -DskipTests'
sshPublisher(publishers: [
sshPublisherDesc(
configName: 'Nightlies',
transfers: [
sshTransfer(
remoteDirectory: '/struts/snapshot',
removePrefix: 'assembly/target/assembly/out',
sourceFiles: 'assembly/target/assembly/out/struts-*.zip',
cleanRemote: true
)
],
verbose: true
)
])
}
}
}
post {
always {
Expand All @@ -84,7 +159,7 @@ pipeline {
stages {
stage('Build') {
steps {
sh './mvnw -B clean install -DskipTests -DskipAssembly'
sh './mvnw -B -DskipAssembly verify --no-transfer-progress'
}
}
stage('Test') {
Expand Down

0 comments on commit 4bc19c7

Please sign in to comment.