This repository has been archived by the owner on Jun 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
tck.sh
executable file
·48 lines (44 loc) · 1.85 KB
/
tck.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#! /bin/bash
OPTION=${1:-NO_OPTION}
OPTION_ARGUMENT=${2:-NO_OPTION_ARGUMENT}
AVAILABLE_PROFILES="java, laravel, express"
if [ "$OPTION" = "NO_OPTION" ] ; then
echo "usage: tck [<option>]"
echo "Option"
echo " clone <dir> clones stormpath-framework-tck locally under directory <dir>."
echo " If no <dir>, then current dir."
echo " run <profile> runs actual TCK tests using profile <profile>. Valid profiles are $AVAILABLE_PROFILES"
echo ""
exit
fi
case "$OPTION" in
clone)
if [ "${OPTION_ARGUMENT}" = "NO_OPTION_ARGUMENT" ] ; then DIR="stormpath-framework-tck"; else DIR="${OPTION_ARGUMENT}"; fi
echo "Checking out TCK"
git config --global user.email "[email protected]"
git config --global user.name "stormpath-sdk-java TCK"
git clone [email protected]:stormpath/stormpath-framework-tck.git ${DIR}
cd ${DIR}
git checkout master
echo "TCK cloned"
#Let's persist the directory name in a temp file called tck_clone_directory so the run phase can find where tck was cloned
echo ${DIR} > $TMPDIR/tck_clone_directory
;;
run)
PROFILE=$OPTION_ARGUMENT
#Let's read the name of the directory where tck was cloned
CLONED_DIR=$(head -n 1 $TMPDIR/tck_clone_directory)
if [ "$PROFILE" = "NO_OPTION_ARGUMENT" ] ; then echo "Missing profile. Valid profiles are $AVAILABLE_PROFILES"; exit; fi
echo "Setting TCK properties"
echo "Using profile: ${PROFILE}"
cd ${CLONED_DIR}
echo "Running TCK now!"
mvn -P$PROFILE clean verify
EXIT_STATUS="$?"
if [ "$EXIT_STATUS" -ne 0 ]; then
echo "TCK found errors!. Exit status was $EXIT_STATUS"
exit $EXIT_STATUS
fi
echo "TCK ran successfully, no errors found!"
;;
esac