From 17b59fb9d5dccbcdcbcf1f8bf908c35bdbef74d8 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Mon, 10 Feb 2020 08:34:01 +0100 Subject: [PATCH] Adds missing stages section --- Jenkinsfile | 80 +++++++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f2a20ea0a..423bc18a6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -78,51 +78,53 @@ pipeline { reuseNode true } } - 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) + stages { + stage('Build') { + steps { + sh 'mvn -B clean package -DskipTests -DskipAssembly' } } - } - stage('Build Source & JavaDoc') { - when { - branch 'master' - } - steps { - dir("local-snapshots-dir/") { - deleteDir() + stage('Test') { + steps { + sh 'mvn -B test' + step([$class: 'JiraIssueUpdater', issueSelector: [$class: 'DefaultIssueSelector'], scm: scm]) } - 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' + post { + always { + junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true) + junit(testResults: '**/failsafe-reports/*.xml', allowEmptyResults: true) + } } } - } - stage('Code Quality') { - when { - branch 'master' + stage('Build Source & JavaDoc') { + when { + branch 'master' + } + steps { + dir("local-snapshots-dir/") { + deleteDir() + } + sh 'mvn -B source:jar javadoc:jar -DskipAssembbly' + } } - 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}' + 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}' + } } } }