diff --git a/jenkins.file b/jenkins.file new file mode 100644 index 000000000..8de06ec67 --- /dev/null +++ b/jenkins.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' + } + } +} \ No newline at end of file diff --git a/jenkinsfile b/jenkinsfile deleted file mode 100644 index dfaa342ff..000000000 --- a/jenkinsfile +++ /dev/null @@ -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' - } - } - } -}