mirror of
https://github.com/aljazceru/signal-cli-rest-api.git
synced 2025-12-18 23:24:20 +01:00
added possibility to publish multiple tags
This commit is contained in:
29
publish.sh
29
publish.sh
@@ -1,10 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
while getopts v: option
|
||||
while getopts v:t: option
|
||||
do
|
||||
case "${option}"
|
||||
in
|
||||
v) VERSION=${OPTARG};;
|
||||
t) TAG=${OPTARG};;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -14,8 +15,20 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$TAG" ]
|
||||
then
|
||||
echo "Please provide a valid tag with the -t flag. e.g: -t stable (supported tags: dev, stable)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$TAG" != "dev" && "$TAG" != "stable" ]]; then
|
||||
echo "Please use either dev or stable as tag"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "This will upload a new signal-cli-rest-api to dockerhub"
|
||||
echo "Version: $VERSION"
|
||||
echo "Tag: $TAG"
|
||||
echo ""
|
||||
|
||||
read -r -p "Are you sure? [y/N] " response
|
||||
@@ -27,10 +40,18 @@ case "$response" in
|
||||
|
||||
docker buildx create --name multibuilder
|
||||
docker buildx use multibuilder
|
||||
|
||||
if [[ "$TAG" == "stable" ]]; then
|
||||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t bbernhard/signal-cli-rest-api:$VERSION . --push
|
||||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t bbernhard/signal-cli-rest-api:latest . --push
|
||||
fi
|
||||
|
||||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t bbernhard/signal-cli-rest-api:$VERSION . --push
|
||||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t bbernhard/signal-cli-rest-api:latest . --push
|
||||
;;
|
||||
if [[ "$TAG" == "dev" ]]; then
|
||||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t bbernhard/signal-cli-rest-api:${VERSION}-dev . --push
|
||||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t bbernhard/signal-cli-rest-api:latest-dev . --push
|
||||
fi
|
||||
|
||||
;;
|
||||
*)
|
||||
echo "Aborting"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user