Skip to content

Commit

Permalink
Make linter happy and clean up some scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminPelletier committed Oct 19, 2023
1 parent 6d17e9c commit 7c52d1b
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ validate-uss-qualifier-docs:

.PHONY: shell-lint
shell-lint:
find . -name '*.sh' | grep -v '^./interfaces' | xargs docker run --rm -v "$(CURDIR):/monitoring" -w /monitoring koalaman/shellcheck
find . -name '*.sh' ! -path "./interfaces/*" | xargs docker run --rm -v "$(CURDIR):/monitoring" -w /monitoring koalaman/shellcheck

.PHONY: json-schema
json-schema:
Expand Down
7 changes: 5 additions & 2 deletions monitoring/atproxy/run_locally.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -eo pipefail

# Find and change to repo root directory
OS=$(uname)
if [[ "$OS" == "Darwin" ]]; then
Expand All @@ -10,9 +12,10 @@ else
fi
cd "${BASEDIR}/../.." || exit 1

cd monitoring
(
cd monitoring || exit 1
make image
cd ..
)

CLIENT_BASIC_AUTH="local_client:local_client"
PUBLIC_KEY="/var/test-certs/auth2.pem"
Expand Down
7 changes: 5 additions & 2 deletions monitoring/mock_uss/run_locally_msgsigning.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -eo pipefail

# Find and change to repo root directory
OS=$(uname)
if [[ "$OS" == "Darwin" ]]; then
Expand All @@ -10,9 +12,10 @@ else
fi
cd "${BASEDIR}/../.." || exit 1

cd monitoring
(
cd monitoring || exit 1
make image
cd ..
)

AUTH="DummyOAuth(http://host.docker.internal:8085/token,uss1)"
DSS="http://host.docker.internal:8082"
Expand Down
5 changes: 3 additions & 2 deletions monitoring/mock_uss/run_locally_test_geoawareness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ else
fi
cd "${BASEDIR}/../.." || exit 1

cd monitoring
(
cd monitoring || exit 1
make image
cd ..
)

PUBLIC_KEY="/var/test-certs/auth2.pem"
container_name="mock_uss_geoawareness_test"
Expand Down
7 changes: 4 additions & 3 deletions monitoring/mock_uss/start_all_local_mocks.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -eo pipefail

Expand All @@ -12,9 +12,10 @@ else
fi
cd "${BASEDIR}/../.." || exit 1

cd monitoring
(
cd monitoring || exit 1
make image
cd ..
)

./monitoring/mock_uss/run_locally.sh up -d

Expand Down
9 changes: 3 additions & 6 deletions monitoring/prober/run_locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ else
fi
cd "${BASEDIR}/../.." || exit 1

cd monitoring
(
cd monitoring || exit 1
make image
cd ..
)

CORE_SERVICE_CONTAINER="local_infra-dss-1"
OAUTH_CONTAINER="local_infra-oauth-1"
Expand All @@ -25,10 +26,6 @@ for container_name in "${localhost_containers[@]}"; do
if [ "$( docker container inspect -f '{{.State.Status}}' "$container_name" )" == "running" ]; then
echo "$container_name available!"
else
echo '#########################################################################'
echo '## Prerequisite to run this command is: ##'
echo '## Local DSS instance + Dummy OAuth server (/build/dev/run_locally.sh) ##'
echo '#########################################################################'
echo "Error: $container_name not running. Execute 'build/dev/run_locally.sh up' before running monitoring/prober/run_locally.sh";
exit 1;
fi
Expand Down
5 changes: 3 additions & 2 deletions monitoring/uss_qualifier/bin/generate_rid_test_definition.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ else
fi
cd "${BASEDIR}/../../.." || exit 1

cd monitoring
(
cd monitoring || exit 1
make image
cd ..
)

CONFIG_LOCATION="monitoring/uss_qualifier/config_run_locally.json"
CONFIG='--config config_run_locally.json'
Expand Down
5 changes: 3 additions & 2 deletions monitoring/uss_qualifier/bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ AUTH="${2:-NoAuth()}"

QUALIFIER_OPTIONS="--auth $AUTH --config /config.json --report output/report.json"

cd monitoring
(
cd monitoring || exit 1
make image
cd ..
)

if [ "$CI" == "true" ]; then
docker_args="--add-host host.docker.internal:host-gateway" # Required to reach other containers in Ubuntu (used for Github Actions)
Expand Down
5 changes: 3 additions & 2 deletions monitoring/uss_qualifier/run_locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ else
fi
cd "${BASEDIR}/../.." || exit 1

cd monitoring
(
cd monitoring || exit 1
make image
cd ..
)

CONFIG_NAME="${1:-ALL}"

Expand Down
5 changes: 3 additions & 2 deletions monitoring/uss_qualifier/scripts/format_test_documentation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ else
fi
cd "${BASEDIR}/../../.." || exit 1

cd monitoring
(
cd monitoring || exit 1
make image
cd ..
)

# shellcheck disable=SC2086
docker run --name test_documentation_formatter \
Expand Down
5 changes: 3 additions & 2 deletions monitoring/uss_qualifier/scripts/format_test_suite_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ else
fi
cd "${BASEDIR}/../../.." || exit 1

cd monitoring
(
cd monitoring || exit 1
make image
cd ..
)

# shellcheck disable=SC2086
docker run --name test_suite_docs_formatter \
Expand Down
5 changes: 3 additions & 2 deletions monitoring/uss_qualifier/scripts/run_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ else
fi
cd "${BASEDIR}/../../.." || exit 1

cd monitoring
(
cd monitoring || exit 1
make image
cd ..
)

# shellcheck disable=SC2086
docker run --name uss_qualifier_unit_test \
Expand Down
5 changes: 3 additions & 2 deletions monitoring/uss_qualifier/scripts/validate_test_definitions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ else
fi
cd "${BASEDIR}/../../.." || exit 1

cd monitoring
(
cd monitoring || exit 1
make image
cd ..
)

# shellcheck disable=SC2086
docker run --name test_definition_validator \
Expand Down

0 comments on commit 7c52d1b

Please sign in to comment.