Reporting/Jenkinsfile
2024-09-09 22:24:02 +02:00

64 lines
1.8 KiB
Groovy

pipeline {
agent {node 'debian'}
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
}
environment {
VERSION = readMavenPom().getVersion()
}
stages {
stage('Checkout') {
steps {
checkout scm
script {
currentBuild.displayName = "${env.BRANCH_NAME}-${env.BUILD_NUMBER}"
}
}
}
stage ('Build') {
steps {
withMaven(jdk: 'JDK1.7_Oracle', maven: 'Maven3', mavenSettingsConfig: 'nexus_settings') {
sh "mvn -Dhttps.protocols=TLSv1.2 -Dmaven.test.failure.ignore=true -P validation clean install"
}
}
post {
success {
archiveArtifacts artifacts: '**/*.ear', fingerprint: true
//
// junit '**/build/surefire-reports/**/*.xml'
}
}
}
stage ('Quality') {
steps {
withSonarQubeEnv('Sonarqube') {
withMaven(jdk: 'JDK1.8_Oracle', maven: 'Maven3', mavenSettingsConfig: 'nexus_settings', mavenOpts: '-Xms256m -Xmx1024m') {
sh "mvn -Dhttps.protocols=TLSv1.2 -Dmaven.test.failure.ignore=true org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:sonar"
}
}
}
}
stage('Deploy VAL') {
when {
beforeAgent true
branch 'TM*'
}
steps {
sh ''
}
}
stage('Package') {
steps {
withMaven(jdk: 'JDK1.7_Oracle', maven: 'Maven3', mavenSettingsConfig: 'nexus_settings') {
sh "mvn -Dhttps.protocols=TLSv1.2 package"
}
}
post {
success {
archiveArtifacts '**/target/*.ear'
archiveArtifacts '**/target/*.zip'
}
}
}
}
}