2018-09-17 12:11:19 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2021-08-05 18:17:59 +02:00
|
|
|
set -e
|
2021-08-05 18:06:43 +02:00
|
|
|
|
2018-11-12 06:58:39 +01:00
|
|
|
if [[ -z $DOCKER_PASSWORD ]] || [[ -z $DOCKER_USERNAME ]]; then
|
2019-06-29 23:27:42 +02:00
|
|
|
docker login
|
2018-11-08 10:56:11 +01:00
|
|
|
fi
|
|
|
|
|
2020-12-12 13:05:58 +01:00
|
|
|
if [[ -z $1 ]] && [[ -z $2 ]]; then
|
2018-11-08 10:56:11 +01:00
|
|
|
echo "Please provide a container image name and version" 1>&2
|
|
|
|
exit 1
|
2020-12-12 13:05:58 +01:00
|
|
|
elif [[ $1 ]] && [[ -z $2 ]]; then
|
2020-12-26 17:02:15 +01:00
|
|
|
echo "Pushing 'photoprism/$1:preview' to Docker hub...";
|
|
|
|
docker push photoprism/$1:preview
|
2020-12-12 13:05:58 +01:00
|
|
|
echo "Done"
|
2018-11-08 10:56:11 +01:00
|
|
|
else
|
|
|
|
echo "Pushing 'photoprism/$1:$2' to Docker hub...";
|
|
|
|
docker push photoprism/$1:latest
|
|
|
|
docker push photoprism/$1:$2
|
|
|
|
echo "Done"
|
2019-06-29 23:27:42 +02:00
|
|
|
fi
|