2021-11-23 20:42:01 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-07-22 14:58:20 +02:00
|
|
|
# Login to Docker Hub.
|
2021-12-10 17:01:45 +01:00
|
|
|
scripts/docker/login.sh
|
2021-11-23 20:42:01 +01:00
|
|
|
|
2022-07-22 14:58:20 +02:00
|
|
|
# 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."
|