added jfrog in jenkinsfile

This commit is contained in:
Bharatkumar5690 2023-03-09 17:27:27 +05:30
parent 724b1552a5
commit cf6c717a8c

35
Jenkinsfile vendored
View file

@ -7,9 +7,27 @@ pipeline {
url: 'https://github.com/Bharatkumar5690/spring-petclinic.git'
}
}
stage('Build') {
stage ('Artifactory configuration') {
steps {
sh 'mvn package'
rtServer (
id: "ARTIFACTORY_SERVER",
url: 'https://sbharatkumar.jfrog.io/artifactory',
credentialsId: 'JFROG_CLOUD_ADMIN'
)
rtMavenDeployer (
id: "MAVEN_DEPLOYER",
serverId: "ARTIFACTORY_SERVER",
releaseRepo: 'libs-release',
snapshotRepo: 'libs-snapshot'
)
rtMavenResolver (
id: "MAVEN_RESOLVER",
serverId: "ARTIFACTORY_SERVER",
releaseRepo: 'libs-release',
snapshotRepo: 'libs-snapshot'
)
}
}
stage('Test the code by using sonarqube') {
@ -19,6 +37,19 @@ pipeline {
}
}
}
stage ('Exec Maven') {
steps {
rtMavenRun (
tool: 'MAVEN_DEFAULT',
pom: 'pom.xml',
goals: 'clean install',
deployerId: "MAVEN_DEPLOYER",
)
rtPublishBuildInfo (
serverId: "ARTIFACTORY_SERVER"
)
}
}
stage('Gathering the artifacts & test results') {
steps {
archiveArtifacts artifacts: '**/target/*.jar',