2016-03-11 17:37:41 +00:00
|
|
|
#!/bin/bash
|
2014-11-13 15:21:28 +00:00
|
|
|
|
|
|
|
if [[ -z "$1" ]]; then
|
|
|
|
echo "Usage: ./build-docker.sh def_file_name version_number"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -z "$2" ]]; then
|
|
|
|
echo "Usage: ./build-docker.sh def_file_name version_number"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2014-11-13 20:34:19 +00:00
|
|
|
echo "Starting build..."
|
2016-03-11 17:37:41 +00:00
|
|
|
cp "$1" ./prosody.deb
|
|
|
|
docker build -t prosody/prosody:"$2" .
|
2014-11-15 15:15:58 +00:00
|
|
|
for i in "${@:3}"; do
|
|
|
|
echo "Also building tag $i"
|
2016-03-11 17:37:41 +00:00
|
|
|
docker build -t prosody/prosody:"$i" .
|
2014-11-15 15:15:58 +00:00
|
|
|
done
|
2014-11-13 15:21:28 +00:00
|
|
|
docker push prosody/prosody
|
2014-11-13 20:34:19 +00:00
|
|
|
|
|
|
|
echo "Cleaning up..."
|
2016-03-11 17:37:41 +00:00
|
|
|
docker rmi prosody/prosody:"$2"
|
2014-11-15 15:15:58 +00:00
|
|
|
for i in "${@:3}"; do
|
|
|
|
echo "Also cleaning tag $i"
|
2016-03-11 17:37:41 +00:00
|
|
|
docker rmi prosody/prosody:"$i"
|
2014-11-15 15:15:58 +00:00
|
|
|
done
|
|
|
|
rm ./prosody.deb
|