From 6f17eec93dc5a807d1c32ffb0bb29fd86a65a983 Mon Sep 17 00:00:00 2001 From: DokurOmkar Date: Thu, 11 Jul 2024 11:57:39 -0700 Subject: [PATCH] VH 1324 - Filter the versions returned from the initialization script (#623) # PR Details ## Description In this PR, updated the docker compose file to change the "LOCAL_IP" variable to "V2XHUB_IP" and updated the initialization script to remove the following from the returned versions: - Curly braces: **^{}** - Properties found - Duplicate entries ## Related Issue ## Motivation and Context ## How Has This Been Tested? This has been tested by running the script locally. A screenshot is attached below after testing. ![Screenshot from 2024-07-11 08-42-58](https://github.com/usdot-fhwa-OPS/V2X-Hub/assets/6395329/003d06a0-ff09-4376-bcca-00f1a8d975e4) ## Types of changes - [x] Defect fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that cause existing functionality to change) ## Checklist: - [ ] I have added any new packages to the sonar-scanner.properties file - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have read the **CONTRIBUTING** document. [V2XHUB Contributing Guide](https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/develop/Contributing.md) - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. --- configuration/docker-compose.yml | 2 +- configuration/initialization.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configuration/docker-compose.yml b/configuration/docker-compose.yml index 3938dc5cc..61f61926d 100755 --- a/configuration/docker-compose.yml +++ b/configuration/docker-compose.yml @@ -40,7 +40,7 @@ services: - SIMULATION_MODE=${SIMULATION_MODE:-false} - SIMULATION_IP=${SIMULATION_IP:-127.0.0.1} - SIMULATION_REGISTRATION_PORT=6767 - - LOCAL_IP=${LOCAL_IP:-127.0.0.1} + - LOCAL_IP=${V2XHUB_IP:-127.0.0.1} - TIME_SYNC_TOPIC=time_sync - TIME_SYNC_PORT=7575 - SIM_V2X_PORT=5757 diff --git a/configuration/initialization.sh b/configuration/initialization.sh index 82b556ebb..ba43e353a 100755 --- a/configuration/initialization.sh +++ b/configuration/initialization.sh @@ -23,9 +23,12 @@ latest_version=$(echo "$release_info" | grep -o '"tag_name": *"[^"]*"' | cut -d # Fetching all tags from Git repository tags=$(git ls-remote --tags https://github.com/usdot-fhwa-OPS/V2X-Hub.git | awk -F/ '{print $3}' | sort -V) +# Remove curly braces, Properties found, and duplicate entries +updated_tags=$(echo "$tags" | sed 's/\^{}//' | grep -v '^Properties_Found$' | awk '!seen[$0]++') + # Displaying all available versions echo "Available versions:" -echo "$tags" +echo "$updated_tags" # select a version or accept the latest version as default read -r -p "Enter V2X-Hub Version (choose from the above, or press Enter to use latest version $latest_version): " chosen_version