From 47f16b8a3afedbd5c7274b715af727e25b62996c Mon Sep 17 00:00:00 2001 From: John Morrison Date: Fri, 12 Jun 2020 14:24:04 -0700 Subject: [PATCH] docker: check that entrypoints and gunicorn work --- .circleci/config.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 702e4f72..4318fb62 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,6 +28,24 @@ jobs: - run: name: Test nose command: docker run -it app:build test_nose + - run: + name: Test that the `python` entrypoint responds + command: | + set -e + docker run -it app:build python --version + - run: + name: Test that the `server` entrypoint starts ok + command: | + set -e + container_name=$(docker run -it -e MOZSVC_SQLURI="sqlite:////tmp/tokenserver.db" --rm -d app:build server) + # Grab the logs now in case this crashes and is removed. + (docker logs --follow $container_name &) + sleep 10 + # If the container above stops before running 10 seconds, the + # `--rm` will remove it and this `docker inspect` will exit + # non-zero, failing this step. + docker inspect -f '{{.State.Running}}' $container_name + docker kill $container_name - store_test_results: path: test_results - run: