Update Jenkinsfile

This commit is contained in:
nagarjuna33 2023-04-24 19:08:43 +05:30 committed by GitHub
parent e05ad47a2e
commit ba19c2c355
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

47
Jenkinsfile vendored
View file

@ -1,10 +1,5 @@
pipeline{
agent { label 'node1' }
// 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')
}
agent any
stages {
stage('scm') {
steps {
@ -15,43 +10,9 @@ stages {
stage ('SONAR QUBE SCAN') {
steps{
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"
)
}
}
sh 'mvn clean install'
}
}
}
}