openapi-generator/bin/openapi3/run-all-petstore
Jim Schubert 1ac0f141a6
[feature] Default CI log level for slf4j-simple to error to prevent noise (#5118)
* [feature] Log "debounce" filter to remove spam.

* [log] slf4j-simple should be optional

This also sets the default log level to ERROR during CI builds for many
mvn invocations. This should reduce noise in the logs.

* [log] Rely only on mvn loglevel=error for now

* [cli] Clean up unused dependency

* [log] Change level to error/warn in more CI
2020-01-29 16:28:42 +08:00

35 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# this bash script will loop through all the .sh files under bin
# execute the script and check the result (exit code) to see if
# there's any error
echo "IMPORTANT: this script should be run by the CI (e.g. Shippable) only. There's no need to run this script to update Petstore samples for all generators."
echo "Please press CTRL+C to stop or the script will continue in 10 seconds."
sleep 10
successes=0
failures=0
export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true -Dorg.slf4j.simpleLogger.defaultLogLevel=warn"
for SCRIPT in $(ls -l ./bin/openapi3/*.sh | grep -v all)
do
if [ -f ${SCRIPT} -a -x ${SCRIPT} ]; then
echo "Running $SCRIPT (output to /dev/null)"
${SCRIPT} 2>&1 > /dev/null
rc=$?
if [[ ${rc} != 0 ]]; then
>&2 echo "ERROR!! FAILED TO RUN ${SCRIPT}"
((failures+=1))
else
((successes+=1))
fi
fi
done
if (( failures > 0 )); then
>&2 echo "[ERROR] ${failures} out of $((failures+successes)) scripts failed."
exit 1
else
echo "[SUCCESS] ${successes} generators finished."
fi