mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-25 09:05:50 +00:00
Update Jenkinsfile
This commit is contained in:
parent
2fe319a540
commit
e05ad47a2e
1 changed files with 40 additions and 9 deletions
49
Jenkinsfile
vendored
49
Jenkinsfile
vendored
|
@ -1,9 +1,9 @@
|
|||
pipeline{
|
||||
agent { label 'node' }
|
||||
agent { label 'node1' }
|
||||
// triggers { pollSCM ('H * * * 1-5') }
|
||||
parameters {
|
||||
choice (name: 'BRANCH_TO_BUILD', choices: ['main'], description: 'Branch to build')
|
||||
string (name: 'MAVEN_GOAL', defaultValue: 'clean install', description: 'maven goal')
|
||||
choice (name: 'BRANCH_TO_BUILD', choices: ['main', 'Dev', 'Test'], description: 'Branch to build')
|
||||
string (name: 'MAVEN_GOAL', defaultValue: 'clean package', description: 'maven goal')
|
||||
}
|
||||
stages {
|
||||
stage('scm') {
|
||||
|
@ -13,14 +13,45 @@ stages {
|
|||
}
|
||||
}
|
||||
|
||||
stage ('sonarqube') {
|
||||
stage ('SONAR QUBE SCAN') {
|
||||
steps{
|
||||
withSonarQubeEnv('sonarqube') {
|
||||
sh 'mvn clean package sonar:sonar -Dsonar.login=sonartoken'
|
||||
withSonarQubeEnv('SONAR_SCAN') {
|
||||
sh 'mvn clean package sonar:sonar'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Quality Gate') {
|
||||
steps {
|
||||
timeout(time: 20, unit: 'MINUTES'){
|
||||
waitForQualityGate abortPipeline: true
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('upload package to the jfrog ') {
|
||||
steps {
|
||||
rtUpload (
|
||||
serverId: 'JFROG_ID',
|
||||
spec: '''{
|
||||
"files": [
|
||||
{
|
||||
"pattern": "./target/*.jar",
|
||||
"target": "libs-release-local/"
|
||||
}
|
||||
]
|
||||
}''',
|
||||
buildName: "$env.JOB_NAME",
|
||||
buildNumber: "$env.BUILD_NUMBER",
|
||||
project: 'springpet'
|
||||
)
|
||||
}
|
||||
}
|
||||
stage ('Publish build info') {
|
||||
steps {
|
||||
rtPublishBuildInfo (
|
||||
serverId: "JFROG_ID"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue