From ed31bca4c9efb89ad7b0a2242d51360ab5188e35 Mon Sep 17 00:00:00 2001 From: Chesnay Schepler Date: Tue, 15 Aug 2023 17:57:29 +0200 Subject: [PATCH] [FLINK-32834] Add usage information and -h option to low-level scripts --- tools/ci/license_check.sh | 26 ++++++++++++++++++++++++++ tools/ci/verify_bundled_optional.sh | 24 ++++++++++++++++++++++++ tools/ci/verify_scala_suffixes.sh | 18 ++++++++++++++++++ 3 files changed, 68 insertions(+) diff --git a/tools/ci/license_check.sh b/tools/ci/license_check.sh index 4f2aebbde00..f31a6665061 100755 --- a/tools/ci/license_check.sh +++ b/tools/ci/license_check.sh @@ -17,6 +17,32 @@ # limitations under the License. ################################################################################ +usage() { + echo "Usage: $0 " + echo " A file containing the output of the Maven build." + echo " A directory containing a Maven repository into which the Flink artifacts were deployed." + echo "" + echo "Example preparation:" + echo " mvnw clean deploy -DaltDeploymentRepository=validation_repository::default::file: > " + echo "" + echo "The environment variable MVN is used to specify the Maven binaries; defaults to 'mvnw'." + echo "See further details in the JavaDoc of LicenseChecker." +} + +while getopts 'h' o; do + case "${o}" in + h) + usage + exit 0 + ;; + esac +done + +if [[ "$#" != "2" ]]; then + usage + exit 1 +fi + MVN_CLEAN_COMPILE_OUT=$1 FLINK_DEPLOYED_ROOT=$2 diff --git a/tools/ci/verify_bundled_optional.sh b/tools/ci/verify_bundled_optional.sh index 34fff60ca2d..0d3dbdf41ba 100755 --- a/tools/ci/verify_bundled_optional.sh +++ b/tools/ci/verify_bundled_optional.sh @@ -17,6 +17,30 @@ # limitations under the License. # +usage() { + echo "Usage: $0 " + echo " A file containing the output of the Maven build." + echo "" + echo "mvnw clean package > " + echo "" + echo "The environment variable MVN is used to specify the Maven binaries; defaults to 'mvnw'." + echo "See further details in the JavaDoc of ShadeOptionalChecker." +} + +while getopts 'h' o; do + case "${o}" in + h) + usage + exit 0 + ;; + esac +done + +if [[ "$#" != "1" ]]; then + usage + exit 1 +fi + ## Checks that all bundled dependencies are marked as optional in the poms MVN_CLEAN_COMPILE_OUT=$1 diff --git a/tools/ci/verify_scala_suffixes.sh b/tools/ci/verify_scala_suffixes.sh index 4c5cc389eb3..45fca80a842 100755 --- a/tools/ci/verify_scala_suffixes.sh +++ b/tools/ci/verify_scala_suffixes.sh @@ -37,6 +37,24 @@ # # The script uses 'mvn dependency:tree -Dincludes=org.scala-lang' to list Scala # dependent modules. + + +usage() { + echo "Usage: $0" + echo "" + echo "The environment variable MVN is used to specify the Maven binaries; defaults to 'mvnw'." + echo "See further details in the JavaDoc of ScalaSuffixChecker." +} + +while getopts 'h' o; do + case "${o}" in + h) + usage + exit 0 + ;; + esac +done + MVN=${MVN:-./mvnw} echo "--- Flink Scala Dependency Analyzer ---"