-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
30 lines (28 loc) · 830 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
pipeline{
agent any
stages{
stage("cleanup"){
steps{
sh 'docker rm -f $(docker ps -a -q) || true'
sh 'docker network create new-network || true'
}
}
stage("build"){
steps{
sh 'docker build -t nginx-image -f Dockerfile.nginx .'
sh 'docker build -t flask-app-image .'
}
}
stage("run"){
steps{
sh 'docker run -d --network new-network --name flask-app flask-app-image'
sh 'docker run -d --network new-network -p 80:80 --name nginx-container nginx-image'
}
}
stage("test"){
steps{
sh 'curl localhost || true'
}
}
}
}