2018-07-26 06:40:52 -05:00
|
|
|
#!/bin/sh
|
2018-08-06 09:26:59 -05:00
|
|
|
set -e
|
2018-07-26 06:40:52 -05:00
|
|
|
|
|
|
|
_grafana_tag=$1
|
|
|
|
|
2018-07-30 07:05:56 -05:00
|
|
|
# If the tag starts with v, treat this as a official release
|
|
|
|
if echo "$_grafana_tag" | grep -q "^v"; then
|
|
|
|
_grafana_version=$(echo "${_grafana_tag}" | cut -d "v" -f 2)
|
|
|
|
_docker_repo=${2:-grafana/grafana}
|
|
|
|
else
|
|
|
|
_grafana_version=$_grafana_tag
|
|
|
|
_docker_repo=${2:-grafana/grafana-dev}
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "pushing ${_docker_repo}:${_grafana_version}"
|
|
|
|
docker push "${_docker_repo}:${_grafana_version}"
|
2018-07-26 06:40:52 -05:00
|
|
|
|
2018-08-16 04:14:12 -05:00
|
|
|
if echo "$_grafana_tag" | grep -q "^v" && echo "$_grafana_tag" | grep -vq "beta"; then
|
2018-07-30 07:05:56 -05:00
|
|
|
echo "pushing ${_docker_repo}:latest"
|
|
|
|
docker push "${_docker_repo}:latest"
|
2018-08-16 04:14:12 -05:00
|
|
|
elif echo "$_grafana_tag" | grep -q "master"; then
|
2018-07-26 06:40:52 -05:00
|
|
|
echo "pushing grafana/grafana:master"
|
|
|
|
docker push grafana/grafana:master
|
|
|
|
fi
|