Files
simple-laravel/gen-tag-list.sh
vista 1c4212f709
All checks were successful
ci/woodpecker/release/build_release/1 Pipeline was successful
ci/woodpecker/release/build_release/2 Pipeline was successful
ci/woodpecker/release/build_release/3 Pipeline was successful
ci/woodpecker/release/build_release/4 Pipeline was successful
health-check and migrate on boot (#25)
add a health check to the container
and option to artisan migrate on boot

Co-authored-by: Ruben Momoa <ruben.lobbes@lobbes.nl>
Reviewed-on: #25
2024-08-30 14:29:44 +02:00

33 lines
847 B
Bash
Executable File

#!/usr/bin/env ash
# 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."
exit 1
fi
# Example v2.0.1
version=$1
# Suffix
suffix=""
if [[ -n $2 ]]; then
suffix="-$2"
fi
touch tags.txt
if [[ "$2" = "php-8" ]]; then
echo "latest" >> tags.txt
fi
# Check if the first character is "V" or "v" and remove it
if [[ "${version:0:1}" == "V" || "${version:0:1}" == "v" ]]; then
version="${version#?}"
fi
echo "latest$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