-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: update docker tags 🐳 * chore: add version to network name * fix: typo
- Loading branch information
Showing
2 changed files
with
38 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Remove any prefixes like "v" from the tag | ||
tag="${1#v}" | ||
# Input string | ||
input_string="$1" | ||
|
||
# Extract major and minor version using cut command | ||
version=$(echo "$tag" | cut -d. -f1,2) | ||
# Regular expression to match version pattern (X.Y.Z or X.Y) | ||
# This pattern looks for numbers separated by dots. | ||
# The -E flag is used for extended regex, and -o to output only the matched part. | ||
version=$(echo "$input_string" | grep -Eo '[0-9]+\.[0-9]+(\.[0-9]+)?') | ||
|
||
# Check if a version was found | ||
if [[ -z "$version" ]]; then | ||
exit 0 | ||
fi | ||
|
||
# Extract major and minor version | ||
major_minor=$(echo "$version" | cut -d. -f1,2) | ||
|
||
# Output the major and minor version | ||
echo "$version" | ||
echo "$major_minor" |