Avoids parallel builds to avoid problems with clean

This commit is contained in:
Lukasz Lenart
2020-02-11 19:42:45 +01:00
parent 5cc73a67ca
commit b806daeb1f
Vendored
+91 -93
View File
@@ -15,121 +15,119 @@ pipeline {
}
stages {
stage('Build on various JDKs') {
parallel {
stage('JDK 11') {
agent {
docker {
label 'ubuntu'
image 'maven:3-jdk-11'
args "$dockerArgs"
reuseNode true
stage('JDK 11') {
agent {
docker {
label 'ubuntu'
image 'maven:3-jdk-11'
args "$dockerArgs"
reuseNode true
}
}
stages {
stage('Build') {
steps {
sh 'mvn -B clean package -DskipTests -DskipAssembly'
}
}
stages {
stage('Build') {
steps {
sh 'mvn -B clean package -DskipTests -DskipAssembly'
}
stage('Test') {
steps {
sh 'mvn -B test'
step([$class: 'JiraIssueUpdater', issueSelector: [$class: 'DefaultIssueSelector'], scm: scm])
}
stage('Test') {
steps {
sh 'mvn -B test'
step([$class: 'JiraIssueUpdater', issueSelector: [$class: 'DefaultIssueSelector'], scm: scm])
}
post {
always {
junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true)
junit(testResults: '**/failsafe-reports/*.xml', allowEmptyResults: true)
}
post {
always {
junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true)
junit(testResults: '**/failsafe-reports/*.xml', allowEmptyResults: true)
}
}
}
}
stage('JDK 9') {
agent {
docker {
label 'ubuntu'
image 'maven:3-jdk-9'
args "$dockerArgs"
reuseNode true
}
stage('JDK 9') {
agent {
docker {
label 'ubuntu'
image 'maven:3-jdk-9'
args "$dockerArgs"
reuseNode true
}
}
stages {
stage('Build') {
steps {
sh 'mvn -B clean package -DskipTests -DskipAssembly'
}
}
stages {
stage('Build') {
steps {
sh 'mvn -B clean package -DskipTests -DskipAssembly'
}
stage('Test') {
steps {
sh 'mvn -B test'
step([$class: 'JiraIssueUpdater', issueSelector: [$class: 'DefaultIssueSelector'], scm: scm])
}
stage('Test') {
steps {
sh 'mvn -B test'
step([$class: 'JiraIssueUpdater', issueSelector: [$class: 'DefaultIssueSelector'], scm: scm])
}
post {
always {
junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true)
junit(testResults: '**/failsafe-reports/*.xml', allowEmptyResults: true)
}
post {
always {
junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true)
junit(testResults: '**/failsafe-reports/*.xml', allowEmptyResults: true)
}
}
}
}
stage('JDK 8') {
agent {
docker {
label 'ubuntu'
image 'maven:3-jdk-8'
args "$dockerArgs"
reuseNode true
}
stage('JDK 8') {
agent {
docker {
label 'ubuntu'
image 'maven:3-jdk-8'
args "$dockerArgs"
reuseNode true
}
}
stages {
stage('Build') {
steps {
sh 'mvn -B clean package -DskipTests -DskipAssembly'
}
}
stages {
stage('Build') {
steps {
sh 'mvn -B clean package -DskipTests -DskipAssembly'
stage('Test') {
steps {
sh 'mvn -B test'
step([$class: 'JiraIssueUpdater', issueSelector: [$class: 'DefaultIssueSelector'], scm: scm])
}
post {
always {
junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true)
junit(testResults: '**/failsafe-reports/*.xml', allowEmptyResults: true)
}
}
stage('Test') {
steps {
sh 'mvn -B test'
step([$class: 'JiraIssueUpdater', issueSelector: [$class: 'DefaultIssueSelector'], scm: scm])
}
stage('Build Source & JavaDoc') {
when {
branch 'master'
}
steps {
dir("local-snapshots-dir/") {
deleteDir()
}
post {
always {
junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true)
junit(testResults: '**/failsafe-reports/*.xml', allowEmptyResults: true)
}
sh 'mvn -B source:jar javadoc:jar -DskipAssembbly'
}
}
stage('Deploy Snapshot') {
when {
branch 'master'
}
steps {
withCredentials([file(credentialsId: 'struts-custom-settings_xml', variable: 'CUSTOM_SETTINGS')]) {
sh 'mvn -s \${CUSTOM_SETTINGS} deploy -skipAssembly'
}
}
stage('Build Source & JavaDoc') {
when {
branch 'master'
}
steps {
dir("local-snapshots-dir/") {
deleteDir()
}
sh 'mvn -B source:jar javadoc:jar -DskipAssembbly'
}
}
stage('Code Quality') {
when {
branch 'master'
}
stage('Deploy Snapshot') {
when {
branch 'master'
}
steps {
withCredentials([file(credentialsId: 'struts-custom-settings_xml', variable: 'CUSTOM_SETTINGS')]) {
sh 'mvn -s \${CUSTOM_SETTINGS} deploy -skipAssembly'
}
}
}
stage('Code Quality') {
when {
branch 'master'
}
steps {
withCredentials([string(credentialsId: 'asf-struts-sonarcloud', variable: 'SONARCLOUD_TOKEN')]) {
sh 'mvn sonar:sonar -DskipAssembly -Dsonar.projectKey=apache_struts -Dsonar.organization=apache -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${SONARCLOUD_TOKEN}'
}
steps {
withCredentials([string(credentialsId: 'asf-struts-sonarcloud', variable: 'SONARCLOUD_TOKEN')]) {
sh 'mvn sonar:sonar -DskipAssembly -Dsonar.projectKey=apache_struts -Dsonar.organization=apache -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${SONARCLOUD_TOKEN}'
}
}
}