-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathjenkinsfile
35 lines (32 loc) · 940 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
pipeline {
agent any
stages {
stage('Build') {
steps {
script {
docker.build('flask_app:1.0.0', '.')
}
}
}
stage('Test') {
steps {
script {
docker.image('flask_app:1.0.0').withRun('-p 4000:4000 --name flask_app --link flask_db -e DB_URL=postgresql://postgres:postgres@flask_db:5432/postgres') {
// Perform testing steps here
}
}
}
}
}
post {
always {
script {
docker.image('flask_app:1.0.0').stop()
docker.image('flask_app:1.0.0').remove()
docker.image('postgres:12').stop()
docker.image('postgres:12').remove()
docker.volume('pgdata').remove()
}
}
}
}