Skip to content

Commit 9d9fb4a

Browse files
Add files via upload
1 parent fad7637 commit 9d9fb4a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Jenkinsfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
pipeline {
2+
agent {
3+
label 'slave1'
4+
}
5+
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+
}

0 commit comments

Comments
 (0)