Skip to content

Commit

Permalink
VH 1324 - Filter the versions returned from the initialization script (
Browse files Browse the repository at this point in the history
…#623)

<!-- Thanks for the contribution, this is awesome. -->

# 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

<!--- Describe your changes in detail -->

## Related Issue

<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

## 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)

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [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:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] 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.
  • Loading branch information
DokurOmkar authored Jul 11, 2024
1 parent 499e04e commit 6f17eec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configuration/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion configuration/initialization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f17eec

Please sign in to comment.