diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..55d2b642d --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,31 @@ +pipeline { + agent any + options { + timeout(time: 1, unit: 'HOURS') + retry(2) + } + 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 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