Jenkinsfile_DP2

This commit is contained in:
vishnu1411 2023-12-16 12:42:51 -05:00
parent 84aa0e24b1
commit 997a09b109
2 changed files with 51 additions and 16 deletions

22
Jenkinsfile vendored
View file

@ -1,20 +1,12 @@
// node {
// stage('sourcecode'){
// //build step
// git branch: 'main', url: 'https://github.com/vishnu1411/spring-petclinic.git'
// }
// stage('Build and install'){
// //building using maven and install
// sh 'mvn clean install'
// }
// stage('Archive test results'){
// //insteall & archive test reuslts
// junit '**/surefire-reports/*xml'
// archiveArtifacts artifacts: '**/*.jar', followSymlinks: false
// }
// }
pipeline {
agent any
options {
timeout(time: 1, unit: 'HOURS')
retry(2)
}
triggers {
cron('* * * * *')
}
stages {
stage ('SourceCode') {

43
scripted_jf_backup Normal file
View file

@ -0,0 +1,43 @@
// node {
// stage('sourcecode'){
// //build step
// git branch: 'main', url: 'https://github.com/vishnu1411/spring-petclinic.git'
// }
// stage('Build and install'){
// //building using maven and install
// sh 'mvn clean install'
// }
// stage('Archive test results'){
// //insteall & archive test reuslts
// junit '**/surefire-reports/*xml'
// archiveArtifacts artifacts: '**/*.jar', followSymlinks: false
// }
// }
pipeline{
agent any
stages {
stage ('SourceCode') {
steps {
//source code from github
git branch: 'main', url: 'https://github.com/vishnu1411/spring-petclinic.git'
}
}
stage ('Build and install') {
steps {
//clean and build using maven
sh 'mvn clean install'
}
}
stage ('Archive test results') {
steps {
//Archive the test results
junit '**/surefire-reports/*xml'
archiveArtifacts artifacts: '**/*.jar', followSymlinks: false
}
}
}
}