Merge pull request #13050 from thalesmg/ci-spellcheck-opts-m-20240514

ci: allow customizing number of jobs when running locally
This commit is contained in:
Thales Macedo Garitezi 2024-05-14 17:25:54 -03:00 committed by GitHub
commit e67b078775
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 1 deletions

View File

@ -6,6 +6,19 @@ set -euo pipefail
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/../.."
PROJ_ROOT="$(pwd)"
NUM_JOBS=10
while getopts "j:" FLAG; do
case "$FLAG" in
j)
NUM_JOBS="${OPTARG}"
;;
*)
echo "unknown flag: $FLAG"
;;
esac
done
shift $((OPTIND-1))
if [ -z "${1:-}" ]; then
SCHEMA="${PROJ_ROOT}/_build/docgen/emqx/schema-en.json"
else
@ -29,7 +42,7 @@ set +e
docker run --rm -i ${DOCKER_TERMINAL_OPT} --name spellcheck \
-v "${PROJ_ROOT}"/scripts/spellcheck/dicts:/dicts \
-v "$SCHEMA":/schema.json \
ghcr.io/emqx/emqx-schema-validate:0.5.1 -j 10 /schema.json
ghcr.io/emqx/emqx-schema-validate:0.5.1 -j "${NUM_JOBS}" /schema.json
result="$?"