Skip to content

Commit

Permalink
optimize image tag script (#911)
Browse files Browse the repository at this point in the history
* add quota for sed

Signed-off-by: Xiang Dai <764524258@qq.com>

* add comment for head

Signed-off-by: Xiang Dai <764524258@qq.com>
  • Loading branch information
daixiang0 authored and rfratto committed Aug 20, 2019
1 parent 52efdfd commit 777fcfc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/image-tag
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ set -o nounset
set -o pipefail

WIP=$(git diff --quiet || echo '-WIP')
BRANCH=$(git rev-parse --abbrev-ref HEAD | sed s#/#-#g)
BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's#/#-#g')
# When 7 chars are not enough to be unique, git automatically uses more.
# We are forcing to 7 here, as we are doing for grafana/grafana as well.
SHA=$(git rev-parse --short=7 HEAD | head -c7)

# If this is a tag, use it, otherwise branch-hash
Expand Down

0 comments on commit 777fcfc

Please sign in to comment.