<commit_before>function get_version {
   local url=$1
   json=$(curl $url/version 2>/dev/null)
   if [ -n "$json" ]; then
      echo $(echo $json|awk -F: '{print $2}'|tr -d "\"}")
      return
   fi
   echo "unknown"
}

function access_service {
   local name=$1
   local url=$2

   if [ -n "$url" ]; then
      version=$(get_version $url)
      echo " $name => $version"
   else
      echo "WARNING $name endpoint not defined; no version info available"
   fi
}

function endpoint_url {
   local host=$1
   local port=$2
   echo "http://$host:$port"
}

if [ -z "$DOCKER_HOST" ]; then
   echo "ERROR $DOCKER_HOST is not defined, aborting"
   exit 1
fi

endpoint=$(echo $DOCKER_HOST | awk -F: '{print $1}')
echo "Versions @ $endpoint"

# deposit auth service
access_service "depositauth service" $(endpoint_url $endpoint 8230)

# deposit registration service
access_service "depositreg service" $(endpoint_url $endpoint 8220)

# entity id service
access_service "entityid service" $(endpoint_url $endpoint 8210)

# token authorizer service
access_service "tokenauth service" $(endpoint_url $endpoint 8200)

# user info service
access_service "userinfo service" $(endpoint_url $endpoint 8240)

# libra2
access_service "libra2 webapp" $(endpoint_url $endpoint 8040)

# deposit registration
access_service "depositreg webapp" $(endpoint_url $endpoint 8221)

# libra2 administration
access_service "libra2 admin webapp" $(endpoint_url $endpoint 8222)

exit 0<commit_msg>Add ORCID access service to version check<commit_after>function get_version {
   local url=$1
   json=$(curl $url/version 2>/dev/null)
   if [ -n "$json" ]; then
      echo $(echo $json|awk -F: '{print $2}'|tr -d "\"}")
      return
   fi
   echo "unknown"
}

function access_service {
   local name=$1
   local url=$2

   if [ -n "$url" ]; then
      version=$(get_version $url)
      echo " $name => $version"
   else
      echo "WARNING $name endpoint not defined; no version info available"
   fi
}

function endpoint_url {
   local host=$1
   local port=$2
   echo "http://$host:$port"
}

if [ -z "$DOCKER_HOST" ]; then
   echo "ERROR $DOCKER_HOST is not defined, aborting"
   exit 1
fi

endpoint=$(echo $DOCKER_HOST | awk -F: '{print $1}')
echo "Versions @ $endpoint"

# deposit auth service
access_service "depositauth service" $(endpoint_url $endpoint 8230)

# deposit registration service
access_service "depositreg service" $(endpoint_url $endpoint 8220)

# entity id service
access_service "entityid service" $(endpoint_url $endpoint 8210)

# ORCID access service
access_service "ORCID access service" $(endpoint_url $endpoint 8250)

# token authorizer service
access_service "tokenauth service" $(endpoint_url $endpoint 8200)

# user info service
access_service "userinfo service" $(endpoint_url $endpoint 8240)

# libra2
access_service "libra2 webapp" $(endpoint_url $endpoint 8040)

# deposit registration
access_service "depositreg webapp" $(endpoint_url $endpoint 8221)

# libra2 administration
access_service "libra2 admin webapp" $(endpoint_url $endpoint 8222)

exit 0
{'fraction_non_alphanumeric': 0.11373320222877745, 'fraction_numerical': 0.03146509341199607, 'mean_word_length': 4.345008756567426, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7292833', 'n_tokens_mistral': 1036, 'n_tokens_neox': 966, 'n_words': 317}