diff --git a/ApprovalScript b/ApprovalScript new file mode 100644 index 0000000..1d4337f --- /dev/null +++ b/ApprovalScript @@ -0,0 +1,50 @@ +pipeline{ + + tools{ + maven 'mymaven' + } + + agent any + stages{ + stage('Clone a Repo'){ + steps{ + git 'https://github.com/Sonal0409/DevOpsCodeDemo.git' + } + } + + stage('Compile the code'){ + steps{ + sh 'mvn compile' + } + } + + stage('CodeReview'){ + steps{ + sh 'mvn pmd:pmd' + } + } + + stage('Unit Test'){ + steps{ + sh 'mvn test' + } + } + + stage('Package'){ + steps{ + sh 'mvn package' + script{ + timeout(time: 10, unit: 'MINUTES'){ + input(id: 'DeployGate', message: 'Continue to Deploy', ok: 'Deploy') + } + } + } + } + + stage('Deploy'){ + steps{ + echo 'Deployment done' + } + } + } +} diff --git a/Error-Handling b/Error-Handling new file mode 100644 index 0000000..4f4cc91 --- /dev/null +++ b/Error-Handling @@ -0,0 +1,36 @@ +pipeline{ + agent any + + tools{ + maven 'mymaven' + } + stages{ + stage('Checkout code'){ + steps{ + git 'https://github.com/Sonal0409/DevOpsCodeDemo.git' + } + } + stage('Compile Code'){ + + steps{ + sh 'mvn compile' + } + } + stage('Test Code'){ + + steps{ + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE'){ + sh 'mvn te' + } + } + + } + + stage('Package Code'){ + + steps{ + sh 'mvn package' + } + } + } +} diff --git a/Newfiletraigger b/Newfiletraigger index c0e4993..ae219a9 100644 --- a/Newfiletraigger +++ b/Newfiletraigger @@ -1,8 +1,27 @@ +Commit on the repo for polling SCM trigger +Commit for runnign review +doing a new commit on repo + +new change to trigger the pipeline. +this is done for CICD job rundsgdfg +upding the code +khkjhkj + +New commit in the repo +Change on the repo to test webhooks + +A new commit for repo by Sonal + +Commit for a changes + +changes for poll SCM A new commit for webhook testing Change on the repo + + a commit for chnage and jenkisn job should run gdfgfdgfh -A commit for Poll SCM +A commit for Poll SCM xvbgfdgfdh trigger to check Webhook chnage to see if the job run or not. Webhook trigger diff --git a/Parallel-Stages b/Parallel-Stages new file mode 100644 index 0000000..6e0cf18 --- /dev/null +++ b/Parallel-Stages @@ -0,0 +1,42 @@ +pipeline{ + tools{ + maven 'mymaven' + } + agent any + stages{ + stage('Checkout code') + { + steps{ + git 'https://github.com/Sonal0409/DevOpsCodeDemo.git' + } + } + stage ('Parallel Execution') { + parallel{ + + stage('Code Review') + { + steps{ + sh 'mvn pmd:pmd' + } + post{ + success{ + recordIssues sourceCodeRetention: 'LAST_BUILD', tools: [pmdParser(pattern: '**/pmd.xml')] + } + } + } + stage('Test Code'){ + steps{ + sh 'mvn test' + } + post{ + success{ + junit 'target/surefire-reports/*.xml' + } + } + } + } + + + } + } +} diff --git a/deployment.yml b/deployment.yml index 5a03556..edac3cf 100644 --- a/deployment.yml +++ b/deployment.yml @@ -15,7 +15,7 @@ spec: spec: containers: - name: app - image: edu123/devopsimage:4 + image: nginx --- kind: Service diff --git a/dockerfile b/dockerfile index 0c0ccf4..eeb1393 100644 --- a/dockerfile +++ b/dockerfile @@ -1,4 +1,4 @@ FROM tomcat:9 -ADD addressbook.war /usr/local/tomcat/webapps +ADD target/addressbook.war /usr/local/tomcat/webapps CMD ["catalina.sh", "run"] EXPOSE 8080 diff --git a/file-18june b/file-18june new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/file-18june @@ -0,0 +1 @@ + diff --git a/jenkinsfile2 b/jenkinsfile2 index 49ff6df..b15649a 100644 --- a/jenkinsfile2 +++ b/jenkinsfile2 @@ -1,3 +1,4 @@ -This is to test poll SCM with Upstreem downstream pipeline +commit for changes on jenkisn job to runThis is to test poll SCM with Upstreem downstream pipeline new commit +edit for poll scm to trigger the job