-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
118 additions
and
2 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
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,16 @@ | ||
networks: | ||
default: | ||
services: | ||
fits: | ||
image: islandora/fits:main | ||
crayfits: | ||
image: ${DOCKER_REPOSITORY_BASE}-fits:${DOCKER_TAG} | ||
imagemagick: | ||
image: ${DOCKER_REPOSITORY_BASE}-imagemagick:${DOCKER_TAG} | ||
tesseract: | ||
image: ${DOCKER_REPOSITORY_BASE}-tesseract:${DOCKER_TAG} | ||
test: | ||
image: alpine | ||
command: sleep 300 | ||
volumes: | ||
- ./test.sh:/test.sh |
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,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eou pipefail | ||
|
||
SCRIPT_DIR=$(dirname "$(realpath "$0")") | ||
cd "$SCRIPT_DIR" | ||
docker compose up -d | ||
|
||
docker exec ci-test-1 apk update | ||
docker exec ci-test-1 apk add bash curl file | ||
docker exec ci-test-1 /test.sh | ||
echo $? | ||
|
||
docker compose down | ||
docker compose rm |
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,64 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eou pipefail | ||
|
||
hash() { | ||
if command -v md5sum >/dev/null 2>&1; then | ||
md5sum "$@" | ||
else | ||
md5 "$@" | ||
fi | ||
} | ||
|
||
SERVICES=( | ||
# "tesseract" | ||
# "imagemagick" | ||
"crayfits" | ||
) | ||
for SERVICE in "${SERVICES[@]}"; do | ||
URL="http://$SERVICE:8080/" | ||
echo "Testing $SERVICE at $URL" | ||
|
||
if [ "$SERVICE" == "crayfits" ]; then | ||
curl -s -o fits.xml \ | ||
--header "Accept: application/xml" \ | ||
--header "Apix-Ldp-Resource: https://preserve.lehigh.edu/_flysystem/fedora/2024-01/384659.pdf" \ | ||
"$URL" | ||
# check the md5 of that file exists in the FITS XML | ||
grep c4b7c84671428767e3b0d9193c9c444b fits.xml | grep -q md5checksum && echo "FITS ran successfully" | ||
rm fits.xml | ||
elif [ "$SERVICE" == "ffmpeg" ]; then | ||
curl -s -o image.jpg \ | ||
--header "X-Islandora-Args: -ss 00:00:45.000 -frames 1 -vf scale=720:-2" \ | ||
--header "Accept: image/jpeg" \ | ||
--header "Apix-Ldp-Resource: http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" \ | ||
"$URL" | ||
hash image.jpg | grep fe7dd57460dbaf50faa38affde54b694 | ||
rm image.jpg | ||
elif [ "$SERVICE" == "imagemagick" ]; then | ||
curl -s -o image.png \ | ||
--header "Accept: image/png" \ | ||
--header "Apix-Ldp-Resource: https://preserve.lehigh.edu/_flysystem/fedora/2024-01/384659.pdf" \ | ||
"$URL" | ||
file image.png | grep -q PNG && echo "PNG thumbnail created from PDF" | ||
rm image.png | ||
elif [ "$SERVICE" == "tesseract" ]; then | ||
curl -s -o ocr.txt \ | ||
--header "Accept: text/plain" \ | ||
--header "Apix-Ldp-Resource: https://preserve.lehigh.edu/sites/default/files/2023-12/285660.jpg" \ | ||
"$URL" | ||
grep -q Pyrases ocr.txt || exit 1 | ||
echo "Image OCR as expected" | ||
|
||
curl -s -o ocr.txt \ | ||
--header "Accept: text/plain" \ | ||
--header "Apix-Ldp-Resource: https://preserve.lehigh.edu/_flysystem/fedora/2024-01/384659.pdf" \ | ||
"$URL" | ||
grep "One time I was ridin' along on the mule" ocr.txt || exit 1 | ||
echo "PDF OCR as expected" | ||
rm ocr.txt | ||
else | ||
echo "Unknown service" | ||
exit 1 | ||
fi | ||
done |
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