forked from Elad0109/simple-webapp-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
29 lines (29 loc) · 724 Bytes
/
Copy pathJenkinsfile
File metadata and controls
29 lines (29 loc) · 724 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
pipeline {
agent any
stages {
stage("Initialize") {
steps {
cleanWs()
}
}
stage('Get SCM') {
steps {
git "https://github.com/noaiz/simple-webapp-nodejs.git"
sh "cat Jenkinsfile"
}
}
stage('Build') {
steps {
sh "docker build -t nodewebapp ."
sh "docker images"
}
}
stage('Deploy') {
steps {
sh "docker kill nodewebapp"
sh "docker rm nodewebapp"
sh "docker run -itd --name nodewebapp -p 8081:3000 nodewebapp:latest &"
}
}
}
}