From 6cf88cc0e2b05da6e11f9e92bfaa8f426d9dc75e Mon Sep 17 00:00:00 2001 From: vishnu1411 Date: Sat, 16 Dec 2023 10:26:02 -0500 Subject: [PATCH 1/8] Jenkinsfile_SP --- Jenkinsfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..391dfd383 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,15 @@ +node('SP'){ + stage('sourcecode'){ + //build step + git branch: 'main', url: 'https://github.com/vishnu1411/spring-petclinic.git' + } + stage('Build and package'){ + //building using maven and install + sh 'mvn clean package' + } + stage('Archive test results'){ + //archive test reuslts + junit '**/surefire-reports/*xml' + archiveArtifacts artifacts: '**/*.war', followSymlinks: false + } +} \ No newline at end of file From ca5d9dede1aeb1dfac9ebceae6bb036081904a6d Mon Sep 17 00:00:00 2001 From: vishnu1411 Date: Sat, 16 Dec 2023 10:40:45 -0500 Subject: [PATCH 2/8] Jenkinsfile_SP1 --- Jenkinsfile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 391dfd383..d3e83fd4c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,15 +1,15 @@ -node('SP'){ - stage('sourcecode'){ - //build step - git branch: 'main', url: 'https://github.com/vishnu1411/spring-petclinic.git' - } - stage('Build and package'){ - //building using maven and install - sh 'mvn clean package' - } - stage('Archive test results'){ - //archive test reuslts - junit '**/surefire-reports/*xml' - archiveArtifacts artifacts: '**/*.war', followSymlinks: false - } -} \ No newline at end of file + node { + stage('sourcecode'){ + //build step + git branch: 'main', url: 'https://github.com/vishnu1411/spring-petclinic.git' + } + stage('Build and package'){ + //building using maven and install + sh 'mvn clean package' + } + stage('Archive test results'){ + //archive test reuslts + junit '**/surefire-reports/*xml' + archiveArtifacts artifacts: '**/*.war', followSymlinks: false + } + } \ No newline at end of file From 8b606f85ae0558080dbc46b6140328a00dc4d20a Mon Sep 17 00:00:00 2001 From: vishnu1411 Date: Sat, 16 Dec 2023 10:53:05 -0500 Subject: [PATCH 3/8] Jenkinsfile_SP2 --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d3e83fd4c..4e62c5156 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,8 +7,9 @@ //building using maven and install sh 'mvn clean package' } - stage('Archive test results'){ - //archive test reuslts + stage('Install & Archive test results'){ + //insteall & archive test reuslts + shh 'mvn clean install' junit '**/surefire-reports/*xml' archiveArtifacts artifacts: '**/*.war', followSymlinks: false } From 24dbc1fe80440e591773992f87668790679ca5ac Mon Sep 17 00:00:00 2001 From: vishnu1411 Date: Sat, 16 Dec 2023 11:00:25 -0500 Subject: [PATCH 4/8] Jenkinsfile_SP3 --- Jenkinsfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4e62c5156..ca36e5b27 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,14 +3,13 @@ //build step git branch: 'main', url: 'https://github.com/vishnu1411/spring-petclinic.git' } - stage('Build and package'){ + stage('Build and install'){ //building using maven and install - sh 'mvn clean package' + sh 'mvn clean install' } - stage('Install & Archive test results'){ + stage('Archive test results'){ //insteall & archive test reuslts - shh 'mvn clean install' junit '**/surefire-reports/*xml' - archiveArtifacts artifacts: '**/*.war', followSymlinks: false + archiveArtifacts artifacts: '**/*.jar', followSymlinks: false } } \ No newline at end of file From 463eb5e655f9cadeabcdb84b572d0a48fc0ef788 Mon Sep 17 00:00:00 2001 From: vishnu1411 Date: Sat, 16 Dec 2023 11:23:25 -0500 Subject: [PATCH 5/8] Jenkinsfile_DP --- Jenkinsfile | 52 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ca36e5b27..d4aa575e9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,15 +1,43 @@ - node { - stage('sourcecode'){ - //build step - git branch: 'main', url: 'https://github.com/vishnu1411/spring-petclinic.git' + // 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{ + agents any + + stages { + stage ('SourceCode') { + steps { + //source code from github + 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 ('Build and install') { + steps { + //clean and build using maven + sh 'mvn clean install' + } + } - stage('Archive test results'){ - //insteall & archive test reuslts - junit '**/surefire-reports/*xml' - archiveArtifacts artifacts: '**/*.jar', followSymlinks: false + stage ('Archive test results') { + steps { + //Archive the test results + junit '**/surefire-reports/*xml' + archiveArtifacts artifacts: '**/*.jar', followSymlinks: false + } + } - } \ No newline at end of file + } +} \ No newline at end of file From 84aa0e24b18f8e2caaad54037a0c2ea63ff0d423 Mon Sep 17 00:00:00 2001 From: vishnu1411 Date: Sat, 16 Dec 2023 11:25:58 -0500 Subject: [PATCH 6/8] Jenkinsfile_DP1 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d4aa575e9..915de0e68 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ // } // } pipeline{ - agents any + agent any stages { stage ('SourceCode') { From 997a09b109224dc6d12e59fc505c98e5f679f44f Mon Sep 17 00:00:00 2001 From: vishnu1411 Date: Sat, 16 Dec 2023 12:42:51 -0500 Subject: [PATCH 7/8] 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 From e6274162a1ef28ece4bc4146c5c773c5d137b34f Mon Sep 17 00:00:00 2001 From: vishnu1411 Date: Sat, 16 Dec 2023 13:02:05 -0500 Subject: [PATCH 8/8] Jenkinsfile_DP_WH --- Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 585953e5d..55d2b642d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,10 +4,6 @@ pipeline { timeout(time: 1, unit: 'HOURS') retry(2) } - triggers { - cron('* * * * *') - } - stages { stage ('SourceCode') { steps {