diff --git a/Jenkinsfile b/Jenkinsfile index 9f56140..fef56e6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,15 +8,19 @@ pipeline { } stage('test') { steps { - sh 'docker stop pg' - sh 'docker run --rm --name pg -d postgres' - sh 'docker image ls' + sh 'docker container stop pg || true' + sh 'docker container stop workout || true' + 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 { always { sh 'docker stop pg' + sh 'docker stop workout' } } }