From 274730607b98b93b2b0304619d53ce85770c6018 Mon Sep 17 00:00:00 2001 From: vikas varade Date: Tue, 28 Sep 2021 20:37:08 +0530 Subject: [PATCH 1/3] add the jenkinsfile in time tracker project --- Jenkinsfile | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..ca90494d5 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,64 @@ +<<<<<<< HEAD +pipeline { + agent maven + tools { + maven + } + stages { + stage ('Cloning the repository') { + steps { + sh ''' + echo "Cloning the rpo" + ''' + } + } + stage ('Maven Build') { + steps { + sh ''' + echo "Maven Build" + ''' + } + } + stage ('Maven Test') { + steps { + sh ''' + echo "Maven test" + ''' + } + } + stage ('Deploy') { + steps { + sh ''' + echo "Deploy" + ''' + } +======= +pipeline { + agent any + stages { + stage('Clone') { + steps { + echo 'Cloning from repositories' + } +>>>>>>> 66a7fb16bac3dba9bb468c36e0b149e940c021df + } + stage('Build') { + steps { + echo 'Build the maven project' + sh 'mvn clean install' + } + } + stage('Testing') { + steps { + echo 'Testing the project' + sh 'mvn test' + } + } + stage('Deploy') { + steps { + echo 'Deploying the project' + sh 'cp -rf /root/.jenkins/workspace/Demo/target/java-tomcat-maven-example.war /opt/tomcat/webapps' + } + } + } +} From d5fff021848a9c51bcd178bf2158384162d8ff68 Mon Sep 17 00:00:00 2001 From: shraddhaAswar <87692227+shraddhaAswar@users.noreply.github.com> Date: Tue, 28 Sep 2021 21:02:30 +0530 Subject: [PATCH 2/3] Update Jenkinsfile --- Jenkinsfile | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ca90494d5..5b4e3602b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,38 +1,3 @@ -<<<<<<< HEAD -pipeline { - agent maven - tools { - maven - } - stages { - stage ('Cloning the repository') { - steps { - sh ''' - echo "Cloning the rpo" - ''' - } - } - stage ('Maven Build') { - steps { - sh ''' - echo "Maven Build" - ''' - } - } - stage ('Maven Test') { - steps { - sh ''' - echo "Maven test" - ''' - } - } - stage ('Deploy') { - steps { - sh ''' - echo "Deploy" - ''' - } -======= pipeline { agent any stages { @@ -40,7 +5,6 @@ pipeline { steps { echo 'Cloning from repositories' } ->>>>>>> 66a7fb16bac3dba9bb468c36e0b149e940c021df } stage('Build') { steps { @@ -51,13 +15,11 @@ pipeline { stage('Testing') { steps { echo 'Testing the project' - sh 'mvn test' } } stage('Deploy') { steps { echo 'Deploying the project' - sh 'cp -rf /root/.jenkins/workspace/Demo/target/java-tomcat-maven-example.war /opt/tomcat/webapps' } } } From 1fe9e3bd3eb742039724c729351183eea8351192 Mon Sep 17 00:00:00 2001 From: vikas varade Date: Tue, 28 Sep 2021 21:07:01 +0530 Subject: [PATCH 3/3] Adding notification stage --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 5b4e3602b..e819d6983 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,6 +21,11 @@ pipeline { steps { echo 'Deploying the project' } + } + stage('Notify') { + steps { + echo 'send email' + } } } }