summaryrefslogtreecommitdiff
path: root/scripts/docker-test.sh
diff options
context:
space:
mode:
authorRaphael <mail@raphaelkabo.com>2023-05-12 23:44:37 +0100
committerGitHub <noreply@github.com>2023-05-12 23:44:37 +0100
commitffc4241e46aa5204d02a64c279ea58e01f1177ae (patch)
tree9814a56b05c5944d03559f4946f3cc2c4d75bb1f /scripts/docker-test.sh
parent67cf89fd0cfdf56c7e6d6d9bdf93d95d679ce2a1 (diff)
parent090a44df57cec84e460462f0ae2db7fb4f87a7e9 (diff)
Merge pull request #96 from lowercasename/github-actions
Add CI workflow
Diffstat (limited to 'scripts/docker-test.sh')
-rwxr-xr-xscripts/docker-test.sh20
1 files changed, 20 insertions, 0 deletions
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