Update Jenkinsfile

This commit is contained in:
Gabriel Augendre 2018-05-03 11:47:22 +02:00 committed by GitHub
parent df63a4ce89
commit 67cd1a12d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

9
Jenkinsfile vendored
View file

@ -10,17 +10,18 @@ pipeline {
steps { steps {
sh 'docker container stop pg || true' sh 'docker container stop pg || true'
sh 'docker container stop workout || 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 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' sh 'curl http://localhost:8000'
} }
} }
} }
post { post {
always { always {
sh 'docker stop pg' sh 'docker container stop pg'
sh 'docker stop workout' sh 'docker container stop workout'
sh 'docker network remove test_workout'
} }
} }
} }