github.com/drud/ddev@v1.21.5-alpha1.0.20230226034409-94fcc4b94453/containers/ddev-dbserver/test/test_dbserver.sh (about) 1 #!/bin/bash 2 3 # Find the directory of this script 4 DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" 5 6 set -o errexit 7 set -o pipefail 8 set -o nounset 9 10 if [ $# != 3 ]; then 11 echo "Usage: $0 <db_type> <db_version> <tag>, for example $0 mariadb 10.3 v1.17.0" 12 exit 1 13 fi 14 export DB_TYPE=$1 15 export DB_VERSION=$2 16 export TAG=$3 17 export IMAGE=drud/ddev-dbserver-${DB_TYPE}-${DB_VERSION}:${TAG} 18 19 export CURRENT_ARCH=$(../get_arch.sh) 20 21 # /usr/local/bin is added for git-bash, where it may not be in the $PATH. 22 export PATH="/usr/local/bin:$PATH" 23 bats test || (echo "bats tests failed for DB_TYPE ${DB_TYPE} DB_VERSION=${DB_VERSION} TAG=${TAG}" && exit 2) 24 printf "Test successful for DB_TYPE ${DB_TYPE} DB_VERSION=${DB_VERSION} TAG=${TAG}\n\n"