mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-25 17:15:48 +00:00
Update Jenkinsfile
This commit is contained in:
parent
e05ad47a2e
commit
ba19c2c355
1 changed files with 4 additions and 43 deletions
47
Jenkinsfile
vendored
47
Jenkinsfile
vendored
|
@ -1,10 +1,5 @@
|
||||||
pipeline{
|
pipeline{
|
||||||
agent { label 'node1' }
|
agent any
|
||||||
// triggers { pollSCM ('H * * * 1-5') }
|
|
||||||
parameters {
|
|
||||||
choice (name: 'BRANCH_TO_BUILD', choices: ['main', 'Dev', 'Test'], description: 'Branch to build')
|
|
||||||
string (name: 'MAVEN_GOAL', defaultValue: 'clean package', description: 'maven goal')
|
|
||||||
}
|
|
||||||
stages {
|
stages {
|
||||||
stage('scm') {
|
stage('scm') {
|
||||||
steps {
|
steps {
|
||||||
|
@ -15,43 +10,9 @@ stages {
|
||||||
|
|
||||||
stage ('SONAR QUBE SCAN') {
|
stage ('SONAR QUBE SCAN') {
|
||||||
steps{
|
steps{
|
||||||
withSonarQubeEnv('SONAR_SCAN') {
|
sh 'mvn clean install'
|
||||||
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