#!/bin/bash -eu

echo ".: BEGIN $0 rev ${BITBUCKET_COMMIT:-undefined} :."

[[ ! -z ${AUTH0_CLIENT_ID:+true} ]] || {
  echo "ERROR: got empty or unset trying to set AUTH0_CLIENT_ID"
  exit 3
}

[[ ! -z ${AUTH0_CLIENT_SECRET:+true} ]] || {
  echo "ERROR: got empty or unset trying to set AUTH0_CLIENT_SECRET"
  exit 4
}

java -jar customer-connect-${VERSION}-SNAPSHOT.jar ${JAVA_OPTS:-} 2>&1
