#!/bin/bash
set -eo pipefail

IMAGE="cdbattags/openresty-testsuite:latest"

docker run \
  -i --rm \
  --entrypoint=/bin/sh \
  -v "$(pwd)":/lua-resty-jwt \
  -w /lua-resty-jwt \
  --name lua-resty-jwt-tests \
  "$IMAGE" \
  -c 'luarocks make lua-resty-jwt-dev-0.rockspec && prove -j4 -r t; rc=$?; rm -rf t/servroot_* 2>/dev/null; exit $rc'
