final tags fix

[SKIP CI]
This commit is contained in:
Ruben Momoa
2024-08-26 14:17:16 +02:00
parent 82c3f183af
commit 5f3ebf55c5

View File

@@ -2,7 +2,6 @@
# this script generates a tags_file for Buildx (https://woodpecker-ci.org/plugins/Docker%20Buildx)
# Check if a command-line argument is provided
if [ -z "$1" ]; then
echo "Please provide a version as a command-line argument."
@@ -20,11 +19,7 @@ if [[ "${version:0:1}" == "V" || "${version:0:1}" == "v" ]]; then
version="${version#?}"
fi
# Split the version into an array using the "." as a delimiter
# this sets $1 $2 and $3
IFS='.' set -- "$version"
echo "latest$suffix" > tags.txt
echo "$1$suffix" >> tags.txt
echo "$1.$2$suffix" >> tags.txt
echo "$1.$2.$3$suffix" >> tags.txt
echo "$version" | cut -d'.' -f1 | xargs -I {} echo "{}$suffix" >> tags.txt
echo "$version" | cut -d'.' -f1,2 | xargs -I {} echo "{}$suffix" >> tags.txt
echo "$version" | cut -d'.' -f1,2,3 | xargs -I {} echo "{}$suffix" >> tags.txt