diff --git a/build_docker.sh b/build_docker.sh index 8fc0cd63..fde2ffe9 100755 --- a/build_docker.sh +++ b/build_docker.sh @@ -5,7 +5,8 @@ version=$(git describe --tags --always | sed 's/^v//') # note: we may want to extend this to also not tag as latest if working tree is dirty. # but i think because of how go bindata works, it probably makes a change in the working tree. tag=master -grep -q "master" .git/HEAD && [[ "$version" != *-* ]] && tag=latest +BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:-$(git branch --show-current)}} +[[ "$BRANCH" == "master" ]] && [[ "$version" != *-* ]] && tag=latest docker build --tag=grafana/carbon-relay-ng:$tag .