Skip to content

Commit

Permalink
Import image-tag script into build tools so it can be shared
Browse files Browse the repository at this point in the history
We have divergent versions of this script across repos.
This particular version comes from 6334836@scope.
We in particular want this version's changes to support branches
with a '/' character in them.
  • Loading branch information
ekimekim committed Aug 12, 2016
1 parent 7e850f8 commit 5312c40
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions image-tag
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

WORKING_SUFFIX=$(if ! git diff --exit-code --quiet HEAD >&2; \
then echo "-WIP"; \
else echo ""; \
fi)
BRANCH_PREFIX=$(git rev-parse --abbrev-ref HEAD)
echo "${BRANCH_PREFIX//\//-}-$(git rev-parse --short HEAD)$WORKING_SUFFIX"

0 comments on commit 5312c40

Please sign in to comment.