build-docker.sh: Some small improvements for parameter handling

This commit is contained in:
Matthew Wild 2016-03-11 17:37:41 +00:00
parent c095ddd323
commit b98fdd49f4

View file

@ -1,4 +1,4 @@
# /bin/bash #!/bin/bash
if [[ -z "$1" ]]; then if [[ -z "$1" ]]; then
echo "Usage: ./build-docker.sh def_file_name version_number" echo "Usage: ./build-docker.sh def_file_name version_number"
@ -11,18 +11,18 @@ if [[ -z "$2" ]]; then
fi fi
echo "Starting build..." echo "Starting build..."
cp $1 ./prosody.deb cp "$1" ./prosody.deb
docker build -t prosody/prosody:$2 . docker build -t prosody/prosody:"$2" .
for i in "${@:3}"; do for i in "${@:3}"; do
echo "Also building tag $i" echo "Also building tag $i"
docker build -t prosody/prosody:$i . docker build -t prosody/prosody:"$i" .
done done
docker push prosody/prosody docker push prosody/prosody
echo "Cleaning up..." echo "Cleaning up..."
docker rmi prosody/prosody:$2 docker rmi prosody/prosody:"$2"
for i in "${@:3}"; do for i in "${@:3}"; do
echo "Also cleaning tag $i" echo "Also cleaning tag $i"
docker rmi prosody/prosody:$i docker rmi prosody/prosody:"$i"
done done
rm ./prosody.deb rm ./prosody.deb