From 7cdd957d55fe407af21fea4f135c450cb3bf196c Mon Sep 17 00:00:00 2001 From: Benjamin Pelletier Date: Sun, 10 Sep 2023 23:32:27 -0700 Subject: [PATCH] [tooling] Build a lot less (#191) * Build a lot less * Add build limiting --- monitoring/atproxy/run_locally.sh | 5 ++++- monitoring/mock_uss/run_locally_msgsigning.sh | 1 + monitoring/mock_uss/run_locally_test_geoawareness.sh | 1 + monitoring/uss_qualifier/bin/generate_rid_test_definition.sh | 5 ++++- monitoring/uss_qualifier/bin/run.sh | 5 ++++- .../uss_qualifier/scripts/format_test_documentation.sh | 5 ++++- monitoring/uss_qualifier/scripts/format_test_suite_docs.sh | 5 ++++- monitoring/uss_qualifier/scripts/run_unit_tests.sh | 5 ++++- .../uss_qualifier/scripts/validate_test_definitions.sh | 5 ++++- monitoring/uss_qualifier/webapp/run_locally.sh | 5 ++++- schemas/manage_type_schemas.sh | 5 ++++- 11 files changed, 38 insertions(+), 9 deletions(-) diff --git a/monitoring/atproxy/run_locally.sh b/monitoring/atproxy/run_locally.sh index 09f3afa422..eb8262fe34 100755 --- a/monitoring/atproxy/run_locally.sh +++ b/monitoring/atproxy/run_locally.sh @@ -10,7 +10,10 @@ else fi cd "${BASEDIR}/../.." || exit 1 -monitoring/build.sh || exit 1 +if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then + monitoring/build.sh || exit 1 + export DO_NOT_BUILD_MONITORING=true +fi CLIENT_BASIC_AUTH="local_client:local_client" PUBLIC_KEY="/var/test-certs/auth2.pem" diff --git a/monitoring/mock_uss/run_locally_msgsigning.sh b/monitoring/mock_uss/run_locally_msgsigning.sh index 6554424b62..742fef289d 100755 --- a/monitoring/mock_uss/run_locally_msgsigning.sh +++ b/monitoring/mock_uss/run_locally_msgsigning.sh @@ -3,6 +3,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then "${SCRIPT_DIR}/../build.sh" || exit 1 + export DO_NOT_BUILD_MONITORING=true fi AUTH="DummyOAuth(http://host.docker.internal:8085/token,uss1)" diff --git a/monitoring/mock_uss/run_locally_test_geoawareness.sh b/monitoring/mock_uss/run_locally_test_geoawareness.sh index 7f0637881e..d2c6f98168 100755 --- a/monitoring/mock_uss/run_locally_test_geoawareness.sh +++ b/monitoring/mock_uss/run_locally_test_geoawareness.sh @@ -3,6 +3,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then "${SCRIPT_DIR}/../build.sh" || exit 1 + export DO_NOT_BUILD_MONITORING=true fi PUBLIC_KEY="/var/test-certs/auth2.pem" diff --git a/monitoring/uss_qualifier/bin/generate_rid_test_definition.sh b/monitoring/uss_qualifier/bin/generate_rid_test_definition.sh index 7a6af8f629..33e00a296c 100755 --- a/monitoring/uss_qualifier/bin/generate_rid_test_definition.sh +++ b/monitoring/uss_qualifier/bin/generate_rid_test_definition.sh @@ -12,7 +12,10 @@ else fi cd "${BASEDIR}/../../.." || exit 1 -monitoring/build.sh || exit 1 +if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then + monitoring/build.sh || exit 1 + export DO_NOT_BUILD_MONITORING=true +fi CONFIG_LOCATION="monitoring/uss_qualifier/config_run_locally.json" CONFIG='--config config_run_locally.json' diff --git a/monitoring/uss_qualifier/bin/run.sh b/monitoring/uss_qualifier/bin/run.sh index 07c51eba82..92872cf1d9 100755 --- a/monitoring/uss_qualifier/bin/run.sh +++ b/monitoring/uss_qualifier/bin/run.sh @@ -30,7 +30,10 @@ AUTH="${2:-NoAuth()}" QUALIFIER_OPTIONS="--auth $AUTH --config /config.json --report output/report.json" -"$(pwd)"/monitoring/build.sh +if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then + "$(pwd)"/monitoring/build.sh + export DO_NOT_BUILD_MONITORING=true +fi if [ "$CI" == "true" ]; then docker_args="--add-host host.docker.internal:host-gateway" # Required to reach other containers in Ubuntu (used for Github Actions) diff --git a/monitoring/uss_qualifier/scripts/format_test_documentation.sh b/monitoring/uss_qualifier/scripts/format_test_documentation.sh index 673952f4fe..95c18e2bb8 100755 --- a/monitoring/uss_qualifier/scripts/format_test_documentation.sh +++ b/monitoring/uss_qualifier/scripts/format_test_documentation.sh @@ -13,7 +13,10 @@ else fi cd "${BASEDIR}/../../.." || exit 1 -monitoring/build.sh || exit 1 +if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then + monitoring/build.sh || exit 1 + export DO_NOT_BUILD_MONITORING=true +fi # shellcheck disable=SC2086 docker run --name test_documentation_formatter \ diff --git a/monitoring/uss_qualifier/scripts/format_test_suite_docs.sh b/monitoring/uss_qualifier/scripts/format_test_suite_docs.sh index 7a397ca516..d3b0b639c5 100755 --- a/monitoring/uss_qualifier/scripts/format_test_suite_docs.sh +++ b/monitoring/uss_qualifier/scripts/format_test_suite_docs.sh @@ -13,7 +13,10 @@ else fi cd "${BASEDIR}/../../.." || exit 1 -monitoring/build.sh || exit 1 +if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then + monitoring/build.sh || exit 1 + export DO_NOT_BUILD_MONITORING=true +fi # shellcheck disable=SC2086 docker run --name test_suite_docs_formatter \ diff --git a/monitoring/uss_qualifier/scripts/run_unit_tests.sh b/monitoring/uss_qualifier/scripts/run_unit_tests.sh index 2f05e4bcf7..0fe9d77ab7 100755 --- a/monitoring/uss_qualifier/scripts/run_unit_tests.sh +++ b/monitoring/uss_qualifier/scripts/run_unit_tests.sh @@ -13,7 +13,10 @@ else fi cd "${BASEDIR}/../../.." || exit 1 -monitoring/build.sh || exit 1 +if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then + monitoring/build.sh || exit 1 + export DO_NOT_BUILD_MONITORING=true +fi # shellcheck disable=SC2086 docker run --name uss_qualifier_unit_test \ diff --git a/monitoring/uss_qualifier/scripts/validate_test_definitions.sh b/monitoring/uss_qualifier/scripts/validate_test_definitions.sh index ab0388eac1..82f360fa11 100755 --- a/monitoring/uss_qualifier/scripts/validate_test_definitions.sh +++ b/monitoring/uss_qualifier/scripts/validate_test_definitions.sh @@ -13,7 +13,10 @@ else fi cd "${BASEDIR}/../../.." || exit 1 -monitoring/build.sh || exit 1 +if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then + monitoring/build.sh || exit 1 + export DO_NOT_BUILD_MONITORING=true +fi # shellcheck disable=SC2086 docker run --name test_definition_validator \ diff --git a/monitoring/uss_qualifier/webapp/run_locally.sh b/monitoring/uss_qualifier/webapp/run_locally.sh index cbd9d64e90..f1ca1ab2c5 100755 --- a/monitoring/uss_qualifier/webapp/run_locally.sh +++ b/monitoring/uss_qualifier/webapp/run_locally.sh @@ -10,7 +10,10 @@ else fi cd "${BASEDIR}/../../.." || exit 1 -monitoring/build.sh || exit 1 +if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then + monitoring/build.sh || exit 1 + export DO_NOT_BUILD_MONITORING=true +fi # Run monitoring/mock_uss/run_locally_ridsp.sh and # monitoring/mock_uss/run_locally_riddp.sh to produce a mock RID system diff --git a/schemas/manage_type_schemas.sh b/schemas/manage_type_schemas.sh index 7c8097e23f..3d1eae8cf2 100755 --- a/schemas/manage_type_schemas.sh +++ b/schemas/manage_type_schemas.sh @@ -13,7 +13,10 @@ else fi cd "${BASEDIR}/.." || exit 1 -monitoring/build.sh || exit 1 +if [ -z "${DO_NOT_BUILD_MONITORING}" ]; then + monitoring/build.sh || exit 1 + export DO_NOT_BUILD_MONITORING=true +fi action=${1:?The action must be specified as --check or --generate}