This commit is contained in:
KVKR31 2023-08-03 17:08:48 +05:30
parent 8b5bbc5aa4
commit ec032c46db
2 changed files with 44 additions and 31 deletions

44
jenkins.file Normal file
View file

@ -0,0 +1,44 @@
pipeline {
agent {'label JDK_8'}
options {
retry(3)
timeout(time: 30, unit: 'MINUTES')
}
triggers {
corn(* * * * * )
}
tools {
jdk 'JAVA_8'
}
stages {
stage('code') {
steps {
git url: 'https://github.com/KVKR31/dummy.git' ,
branch : 'master'
}
}
stage('package') {
steps {
sh script: ' mvn clean package'
}
}
stage('build') {
steps {
junit testResults: '**/surefire-reports/TEST-*.xml'
archiveArtifacts artifacts: '**/target/gameoflife.war'
}
}
}
pool {
success {
mail subject: 'your project is effective'
body: 'your project is effective'
to: 'vinod@gmail.com'
}
failure {
mail subject: 'your project is failure'
body: 'your project is defective'
to: 'vinod@gmail.com'
}
}
}

View file

@ -1,31 +0,0 @@
pipeline {
stage { label JDK-17}
options {
timeout(time: 30, unit: 'MINUTES')
}
triggers {
pollscm ('* * * * *')
}
tools {
'JDK-17'
}
stages {
stage('vcs') {
steps {
git url: 'https://github.com/KVKR31/dummy.git',
branch: 'main'
}
}
stage('build and package') {
steps {
sh script: 'mvn package'
}
}
stage('reportind') {
steps {
archiveArtifacts artifacts: '**/target/springpetclinic-*.jar'
junit testResults: '**/target/surefire-reports/TEST-*.xml'
}
}
}
}