3 export WORKING_DIR="$( cd "$(dirname "$0")" ; pwd -P )/"
5 DOCKER_COMPOSE_CMD="docker-compose -f ${WORKING_DIR}/docker-compose.yaml";
10 echo "Error: You need to at least provide one argument which is the script to execute";
14 if [ "${ARG}" = "--debug" ]; then
18 if [ -z "$SCRIPT_NAME" ]; then
19 echo "Error: You need to provide the tool name after specifying the --debug flag";
30 CONTAINER_NAME=$(${DOCKER_COMPOSE_CMD} ps -q aai-traversal);
33 echo "Error: seems like the container is not running, please run the commands to start aai-traversal";
37 if [ ${SCRIPT_NAME} = "putTool.sh" ]; then
41 if [ ! -z "${PAYLOAD_FILE}" ] && [ -f "${PAYLOAD_FILE}" ]; then
42 docker cp ${PAYLOAD_FILE} ${CONTAINER_NAME}:/tmp/$(basename ${PAYLOAD_FILE})
46 ${DOCKER_COMPOSE_CMD} exec --user aaiadmin aai-traversal ls /opt/app/aai-traversal/scripts/${SCRIPT_NAME} && {
48 if [ "${ARG}" = "--debug" ]; then
49 ${DOCKER_COMPOSE_CMD} exec --user aaiadmin aai-traversal bash -x /opt/app/aai-traversal/scripts/${SCRIPT_NAME} "$@"
51 ${DOCKER_COMPOSE_CMD} exec --user aaiadmin aai-traversal /opt/app/aai-traversal/scripts/${SCRIPT_NAME} "$@"
56 echo "Unable to find the tool in the /opt/app/aai-traversal/scripts";