From 090a44df57cec84e460462f0ae2db7fb4f87a7e9 Mon Sep 17 00:00:00 2001 From: Raphael Kabo Date: Fri, 12 May 2023 22:56:21 +0100 Subject: Rename and move old Docker test script --- scripts/docker-test.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/docker-test.sh (limited to 'scripts') diff --git a/scripts/docker-test.sh b/scripts/docker-test.sh new file mode 100755 index 0000000..1cba254 --- /dev/null +++ b/scripts/docker-test.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# A Docker-based test script. It builds the Docker image, starts the container, +# and then waits for the server to be ready. Once the server is ready, it +# makes a request to the server and then kills the container. A 200 response +# code is expected. + +set -eux -o pipefail + +cleanup() { + docker-compose kill +} +trap cleanup 0 + +docker-compose up --build & + +while [[ "$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3000/)" -ne "200" ]]; do sleep 5; done +curl -v http://localhost:3000/new/event/public + +cleanup \ No newline at end of file -- cgit v1.2.3