Switch to entrypoint to allow running one-off tests easily. Fix and expand cli options
This commit is contained in:
parent
c4464bfcf1
commit
a1eb535bee
@ -30,4 +30,4 @@ ADD itest.sh /itest.sh
|
||||
ADD bin/gh-ost /usr/local/bin/gh-ost
|
||||
ADD localtests /localtests
|
||||
|
||||
CMD ["/itest.sh"]
|
||||
ENTRYPOINT ["/itest.sh", "-b", "/usr/local/bin/gh-ost"]
|
||||
|
9
itest.sh
9
itest.sh
@ -4,6 +4,7 @@
|
||||
#/
|
||||
#/ Options:
|
||||
#/ --gh-ost-binary | -b path to gh-ost binary. defaults to /tmp/gh-ost-test
|
||||
#/ --test-dir path to test directories. defaults to /localtests
|
||||
|
||||
usage() {
|
||||
code="$1"
|
||||
@ -13,15 +14,19 @@ usage() {
|
||||
exit "$code"
|
||||
}
|
||||
|
||||
GHOST_BINARY=
|
||||
GHOST_BINARY=/tmp/gh-ost-test
|
||||
TEST_DIR=/localtests
|
||||
|
||||
while [ "$#" -gt 0 ];
|
||||
do
|
||||
case "$1" in
|
||||
--gh-ost-binary|-b) GHOST_BINARY="$2"; shift 2;;
|
||||
--gh-ost-binary=*) GHOST_BINARY="$(echo "$1" | cut -d"=" -f"2-")"; shift;;
|
||||
--test-dir) TEST_DIR="$2"; shift 2;;
|
||||
--test-dir=*) TEST_DIR="$(echo "$1" | cut -d"=" -f"2-")"; shift;;
|
||||
--help|-h) usage 0;;
|
||||
-*) usage 1;;
|
||||
*) ;;
|
||||
*) break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user