-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(docker): smoke test the built image
After building the image, this adds a test that it actually runs and reports itself as healthy. This covers that the HTTP server runs, not that the content inside (specifically the React application) is working. Refs #390
- Loading branch information
1 parent
6cf476f
commit c76d5fd
Showing
4 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
function finish() { | ||
echo "Stopping all containers" | ||
docker-compose logs | ||
docker-compose down | ||
} | ||
|
||
trap finish EXIT | ||
|
||
export IMAGE_TAG="${IMAGE_TAG:-local}" | ||
|
||
docker-compose up --detach | ||
container=prereview | ||
|
||
timeout --foreground 20 bash << EOT | ||
while true; do | ||
current=\$(docker inspect "${container}" | jq -r '.[0].State.Health.Status') | ||
echo "${container} is in state: \${current}" | ||
if [ "\$current" == "healthy" ]; then | ||
break | ||
fi | ||
sleep 1 | ||
done | ||
EOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters