Update Jenkinsfile
This commit is contained in:
parent
986999ee8a
commit
df63a4ce89
1 changed files with 7 additions and 3 deletions
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
|
@ -8,15 +8,19 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('test') {
|
stage('test') {
|
||||||
steps {
|
steps {
|
||||||
sh 'docker stop pg'
|
sh 'docker container stop pg || true'
|
||||||
sh 'docker run --rm --name pg -d postgres'
|
sh 'docker container stop workout || true'
|
||||||
sh 'docker image ls'
|
sh 'docker network create test_workout'
|
||||||
|
sh 'docker container run --rm --name pg --network test_workout -d postgres'
|
||||||
|
sh 'docker container run --rm --name workout --network test_workout -p 8000:8000 -e DATABASE_URL=postgres://postgres:postgres@pg:5432/postgres -d workout:jenkins'
|
||||||
|
sh 'curl http://localhost:8000'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
sh 'docker stop pg'
|
sh 'docker stop pg'
|
||||||
|
sh 'docker stop workout'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue