Files
spring-cloud-core-tests/scripts/runTests.sh
2015-12-18 11:44:46 +00:00

46 lines
1018 B
Bash
Executable File

#!/bin/bash
set -o errexit
REPO_URL="${REPO_URL:-https://github.com/spring-cloud-samples/tests.git}"
REPO_BRANCH="${REPO_BRANCH:-master}"
if [[ -d zuul-config-discovery ]]; then
REPO_LOCAL="${REPO_LOCAL:-.}"
else
REPO_LOCAL="${REPO_LOCAL:-tests}"
fi
WAIT_TIME="${WAIT_TIME:-5}"
RETRIES="${RETRIES:-48}"
DEFAULT_VERSION="${DEFAULT_VERSION:-1.0.0.BUILD-SNAPSHOT}"
# Parse the script arguments
while getopts ":r" opt; do
case $opt in
r)
RESET=0
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
# Clone or update the repository
if [[ ! -e "${REPO_LOCAL}/.git" ]]; then
git clone "${REPO_URL}" "${REPO_LOCAL}"
cd "${REPO_LOCAL}"
else
cd "${REPO_LOCAL}"
if [[ $RESET ]]; then
git reset --hard
git pull "${REPO_URL}" "${REPO_BRANCH}"
fi
fi
./mvnw --fail-at-end clean package