corda/sgx-jvm/avian/docker/build.sh
Andras Slemmer 9bb3d6b972 Add 'sgx-jvm/avian/' from commit '09e4fe60d01f4f4bfb6b2976973bb4913ef61edc'
git-subtree-dir: sgx-jvm/avian
git-subtree-mainline: f978eab8d1
git-subtree-split: 09e4fe60d0
2017-03-13 12:18:24 +00:00

42 lines
866 B
Bash
Executable File

#!/bin/sh
if test $# -eq 0; then
echo "Usage: $0 [--container <container_name>] -- <command_to_run_in_docker>"
echo "Ex: $0 make test"
echo "Ex: $0 ./test/ci.sh"
echo "Ex: $0 --container joshuawarner32/avian-build-windows -- make platform=windows"
exit 1
fi
THE_USER="-u $(id -u "${USER}")"
while test $# -gt 1 ; do
key="$1"
case $key in
-c|--container)
shift
CONTAINER="$1"
shift
;;
-r|--root)
shift
THE_USER=
;;
--)
shift
break
;;
*)
break
;;
esac
done
if test -z $CONTAINER; then
CONTAINER=joshuawarner32/avian-build
fi
DIR=$(cd $(dirname "$0") && cd .. && pwd)
docker run --rm -i -t -v "${DIR}":/var/src/avian ${THE_USER} "${CONTAINER}" "${@}"