2018-10-26 07:23:30 -05:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
2018-11-20 10:00:20 -06:00
|
|
|
_raw_grafana_tag=$1
|
2018-10-26 07:23:30 -05:00
|
|
|
_docker_repo=${2:-grafana/grafana-enterprise}
|
|
|
|
|
2018-11-20 10:00:20 -06:00
|
|
|
if echo "$_raw_grafana_tag" | grep -q "^v"; then
|
|
|
|
_grafana_tag=$(echo "${_raw_grafana_tag}" | cut -d "v" -f 2)
|
|
|
|
else
|
|
|
|
_grafana_tag="${_raw_grafana_tag}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Building and deploying ${_docker_repo}:${_grafana_tag}"
|
|
|
|
|
2018-10-26 07:23:30 -05:00
|
|
|
docker build \
|
|
|
|
--tag "${_docker_repo}:${_grafana_tag}"\
|
|
|
|
--no-cache=true \
|
|
|
|
.
|
2018-10-31 10:02:27 -05:00
|
|
|
|
|
|
|
docker push "${_docker_repo}:${_grafana_tag}"
|
2018-12-04 03:49:29 -06:00
|
|
|
|
|
|
|
if echo "$_raw_grafana_tag" | grep -q "^v" && echo "$_raw_grafana_tag" | grep -qv "beta"; then
|
|
|
|
docker tag "${_docker_repo}:${_grafana_tag}" "${_docker_repo}:latest"
|
|
|
|
docker push "${_docker_repo}:latest"
|
|
|
|
fi
|