-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
40 lines (36 loc) · 951 Bytes
/
Jenkinsfile
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
34
35
36
37
38
39
40
pipeline {
agent {
node {
label 'Node-1'
}
}
stages {
stage('Install if docker is not avaliable') {
steps {
sh 'chmod +x ./bash/docker.sh'
sh './bash/docker.sh'
}
}
stage('Checking the Old Container') {
steps {
sh 'chmod +x ./bash/old-container-check.sh'
sh './bash/old-container-check.sh'
}
}
stage('Build Java-Web-Application') {
steps {
sh 'docker build -t dishoneprabu/java-web-app:latest .'
}
}
stage('Launching the latest image') {
steps {
sh 'docker run -d --name java-web-app -h java-web-app -p 8080:8080 --restart unless-stopped dishoneprabu/java-web-app:latest'
}
}
}
post {
always {
echo 'Build Completed'
}
}
}