photoprism/scripts/test.sh
Michael Mayer 3b2f53da07 CI: Update test.sh script and config_filepaths_test.go
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-07-22 14:58:20 +02:00

31 lines
742 B
Bash
Executable file

#!/usr/bin/env bash
# Login to Docker Hub.
scripts/docker/login.sh
# Define functions.
cleanUp() {
COMPOSE_PROJECT_NAME=ci docker-compose -f docker-compose.ci.yml down --remove-orphans
}
# Make sure containers are not running and don't keep running.
cleanUp
trap cleanUp INT
# Set up environment and run tests.
ERROR=0
COMPOSE_PROJECT_NAME=ci docker-compose -f docker-compose.ci.yml pull --ignore-pull-failures && \
COMPOSE_PROJECT_NAME=ci docker-compose -f docker-compose.ci.yml build --pull && \
COMPOSE_PROJECT_NAME=ci docker-compose -f docker-compose.ci.yml run --rm photoprism make all test install migrate || \
ERROR=1
# Stop containers.
cleanUp
# Failed?
if [[ $ERROR == "1" ]]; then
echo "Failed."
exit 1
fi
echo "Done."