From 463eb5e655f9cadeabcdb84b572d0a48fc0ef788 Mon Sep 17 00:00:00 2001 From: vishnu1411 Date: Sat, 16 Dec 2023 11:23:25 -0500 Subject: [PATCH] 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