From 67cd1a12d4353dea083c30803f6cc0f23a749fe6 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 3 May 2018 11:47:22 +0200 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fef56e6..51bf0fd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,17 +10,18 @@ pipeline { steps { sh 'docker container stop pg || true' sh 'docker container stop workout || true' - sh 'docker network create test_workout' + sh 'docker network create test_workout || true' 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 'docker container run --rm --name workout --network test_workout -p 8000:8000 -e DATABASE_URL=postgres://postgres:postgres@pg:5432/postgres -e SECRET_KEY=secret -d workout:jenkins /bin/bash' sh 'curl http://localhost:8000' } } } post { always { - sh 'docker stop pg' - sh 'docker stop workout' + sh 'docker container stop pg' + sh 'docker container stop workout' + sh 'docker network remove test_workout' } } }