Skip to content

Commit 3bcd412

Browse files
Update Jenkinsfile
1 parent 34e0ce4 commit 3bcd412

File tree

1 file changed

+18
-41
lines changed

1 file changed

+18
-41
lines changed

Jenkinsfile

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,30 @@
11
pipeline {
2-
agent {
3-
label 'slave1'
4-
}
5-
2+
agent any
63
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-
}
4+
stage('Git checkout') {
375
steps {
386
echo 'We are now checking out the git repository'
397
git 'https://github.com/rohith-marigowda/javaProject.git'
408
}
41-
9+
}
10+
stage('Build project') {
4211
steps {
43-
echo 'Build the above code using maven'
12+
echo 'Build the above code using maven'
4413
sh 'mvn clean install'
4514
}
46-
47-
steps {
48-
echo 'deploy the artifactories into the master environments'
49-
sh 'sudo cp /home/ec2-user/jenkins/workspace/cicd_master/target/*.war /opt/apache*/webapps/'
15+
}
16+
stage('Push artifactory') {
17+
steps {
18+
echo 'Once the package is created using build tools, push the artifactory to nexus or jfrogg'
19+
echo 'Note: We are not pushing any of our artifacts into maven remote repository'
20+
}
21+
}
22+
23+
stage('Deploy') {
24+
steps {
25+
echo 'deploy the artifactories into the environments'
26+
sh 'sudo cp /home/ec2-user/jenkins/workspace/cicd/target/.war /opt/apache/webapps/'
27+
}
5028
}
5129
}
52-
}
5330
}

0 commit comments

Comments
 (0)