forked from sathyadevops/my-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenfile
33 lines (33 loc) · 861 Bytes
/
jenfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
pipeline {
agent any
stages {
stage('clone repo') {
steps {
sh "rm -rf my-app"
sh "git clone https://github.com/sathyadevops/my-app.git"
sh "mvn clean -f my-app"
}
}
stage('Compile') {
steps {
sh "mvn compile -f my-app"
}
}
stage('Test') {
steps {
sh "mvn test -f my-app"
}
}
stage('package') {
steps {
sh "mvn package -f my-app"
}
}
stage('Deploy') {
steps {
sh "scp -i /root/.ssh/id_rsa /root/.jenkins/workspace/PIPE_LINE1/my-app/target/my-app-1.0-SNAPSHOT.jar 172.31.47.160:/opt"
sh "echo File Deployed"
}
}
}
}