@@ -3,37 +3,47 @@ pipeline {
33 label ' slave1'
44}
55
6- stages {
7- stage(' Git checkout' ) {
6+ // stages {
7+ // stage('Git checkout') {
8+ // steps {
9+ // echo 'We are now checking out the git repository'
10+ // git 'https://github.com/rohith-marigowda/javaProject.git'
11+ // }
12+ // }
13+ // stage('Build project') {
14+ // steps {
15+ // echo 'Build the above code using maven'
16+ // sh 'mvn clean install'
17+ // }
18+ // }
19+ // stage('Push artifactory') {
20+ // steps {
21+ // echo 'Once the package is created using build tools, push the artifactory to nexus or jfrogg'
22+ // echo 'Note: We are not pushing any of our artifacts into maven remote repository'
23+ // }
24+ // }
25+
26+ // stage('Deploy') {
27+ // steps {
28+ // echo 'deploy the artifactories into the environments'
29+ // sh 'sudo cp /home/ec2-user/jenkins/workspace/cicd/target/*.war /opt/apache*/webapps/'
30+ // }
31+ // }
32+
33+ stage(' Master Branch Job' ) {
34+ when {
35+ branch ' master'
36+ }
837 steps {
938 echo ' We are now checking out the git repository'
1039 git ' https://github.com/rohith-marigowda/javaProject.git'
1140 }
12- }
13- stage(' Build project' ) {
41+
1442 steps {
15- echo ' Build the above code using maven'
43+ echo ' Build the above code using maven'
1644 sh ' mvn clean install'
1745 }
18- }
19- stage(' Push artifactory' ) {
20- steps {
21- echo ' Once the package is created using build tools, push the artifactory to nexus or jfrogg'
22- echo ' Note: We are not pushing any of our artifacts into maven remote repository'
23- }
24- }
25-
26- stage(' Deploy' ) {
27- steps {
28- echo ' deploy the artifactories into the environments'
29- sh ' sudo cp /home/ec2-user/jenkins/workspace/cicd/target/*.war /opt/apache*/webapps/'
30- }
31- }
3246
33- stage(' Master Branch Job' ) {
34- when {
35- branch ' master'
36- }
3747 steps {
3848 echo ' deploy the artifactories into the master environments'
3949 sh ' sudo cp /home/ec2-user/jenkins/workspace/cicd_master/target/*.war /opt/apache*/webapps/'
0 commit comments