Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 6 additions & 65 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,73 +1,14 @@
pipeline {
agent { label 'JDK11' }
options {
timeout(time: 1, unit: 'HOURS')
}
triggers {
cron('0 * * * *')
}
agent any
stages {
stage('Source Code') {
stage('Getting code') {
steps {
git url: 'https://github.com/GitPracticeRepo/spring-petclinic.git',
branch: 'main'
git url: 'https://github.com/yaswitha94/spring-petclinic.git',
branch: 'declarative_pipeline'
sh 'mvn package'
}


}
stage('Artifactory-Configuration') {
steps {
rtMavenDeployer (
id: 'spc-deployer',
serverId: 'JFROG_INSTANCE',
releaseRepo: 'qtecomm-libs-release-local',
snapshotRepo: 'qtecomm-libs-snapshot-local',

)
}
}
stage('Build the Code and sonarqube-analysis') {
steps {
// withSonarQubeEnv('SONAR_LATEST') {
// sh script: "mvn ${params.GOAL} sonar:sonar"
// }

rtMavenRun (
// Tool name from Jenkins configuration.
tool: 'MVN_DEFAULT',
pom: 'pom.xml',
goals: 'clean install',
// Maven options.
deployerId: 'spc-deployer',
)

// stash name: 'spc-build-jar', includes: 'target/*.jar'
}
}
stage('reporting') {
steps {
junit testResults: 'target/surefire-reports/*.xml'
}
}
// stage("Quality Gate") {
// steps {
// timeout(time: 1, unit: 'HOURS') {
// waitForQualityGate abortPipeline: true
// }
// }
// }

}
// post {
// success {
// // send the success email
// echo "Success"
// mail bcc: '', body: "BUILD URL: ${BUILD_URL} TEST RESULTS ${RUN_TESTS_DISPLAY_URL} ", cc: '', from: 'devops@qtdevops.com', replyTo: '',
// subject: "${JOB_BASE_NAME}: Build ${BUILD_ID} Succeded", to: 'qtdevops@gmail.com'
// }
// unsuccessful {
// //send the unsuccess email
// mail bcc: '', body: "BUILD URL: ${BUILD_URL} TEST RESULTS ${RUN_TESTS_DISPLAY_URL} ", cc: '', from: 'devops@qtdevops.com', replyTo: '',
// subject: "${JOB_BASE_NAME}: Build ${BUILD_ID} Failed", to: 'qtdevops@gmail.com'
// }
// }
}