Skip to content

Instantly share code, notes, and snippets.

@mcupak
Last active February 20, 2019 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcupak/e5aa4352b4651f11d05a73b7c65fecb1 to your computer and use it in GitHub Desktop.
Save mcupak/e5aa4352b4651f11d05a73b7c65fecb1 to your computer and use it in GitHub Desktop.
script:
# validate
- echo "Validating $URL_TO_VALIDATE:"
- VALIDATION_OUTPUT=`curl -sS "$VALIDATOR_URL=$URL_TO_VALIDATE"`
# print validation errors
- echo $VALIDATION_OUTPUT
# check if the validation output ignoring warnings is an empty array
- VALIDATION_ERROR_COUNT=`echo "$VALIDATION_OUTPUT" |jq -c '.schemaValidationMessages // [] | map(select(.level != "warning"))' |jq length`
- test "$VALIDATION_ERROR_COUNT" == 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment