From 997a09b109224dc6d12e59fc505c98e5f679f44f Mon Sep 17 00:00:00 2001 From: vishnu1411 Date: Sat, 16 Dec 2023 12:42:51 -0500 Subject: [PATCH] Jenkinsfile_DP2 --- Jenkinsfile | 24 ++++++++---------------- scripted_jf_backup | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 scripted_jf_backup diff --git a/Jenkinsfile b/Jenkinsfile index 915de0e68..585953e5d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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{ +pipeline { agent any + options { + timeout(time: 1, unit: 'HOURS') + retry(2) + } + triggers { + cron('* * * * *') + } stages { stage ('SourceCode') { diff --git a/scripted_jf_backup b/scripted_jf_backup new file mode 100644 index 000000000..915de0e68 --- /dev/null +++ b/scripted_jf_backup @@ -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 + } + + } + } +} \ No newline at end of file