-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathJenkinsfile
More file actions
33 lines (33 loc) · 861 Bytes
/
Jenkinsfile
File metadata and controls
33 lines (33 loc) · 861 Bytes
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") {
steps {
git branch: 'main', url: 'https://github.com/ArunMagi/sample-java-spring-app.git'
}
}
stage ("build") {
steps {
sh "mvn clean install"
}
}
stage ("docker image"){
steps {
sh "docker build -t arunmagi/java ."
sh "docker images"
}
}
stage("docker hub") {
steps {
sh "docker login -u arunmagi -p Arun@ak@99"
sh "docker push arunmagi/java"
}
}
stage ("docker conatainer"){
steps {
sh "docker rm -f java"
sh "docker run -d --name java -p 8087:8080 arunmagi/java"
}
}
}
}