Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VH 1324 - Filter the versions returned from the initialization script #623

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor

@paulbourelly999 paulbourelly999 Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On issue I am realizing right now is that getting tags may return tags that are not associated with any release. Maybe we should considered install gh' as part of this script and using the output of gh release list` which looks like this
image
This ensures all provided options are actual releases, does not included any duplicates and includes information about release date and most recent release. What do you think. Only additional edit that may be necessary is to make sure the prompt for selecting a release indicates that you use the tag name.

Copy link
Contributor Author

@DokurOmkar DokurOmkar Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As using "gh" would require an additional step of installing it. As part of this bug, we can work on removing the unwanted characters and add a follow up story to make an enhancement.

In the follow up story, we can add a logic to check if gh installed or not and add installation commands within this script.


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