Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Commit

Permalink
Merge pull request weaveworks#28 from weaveworks/mike/add-image-tag
Browse files Browse the repository at this point in the history
Import image-tag script into build tools so it can be shared
  • Loading branch information
ekimekim authored Aug 12, 2016
2 parents 7e850f8 + 5312c40 commit db5efc0
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 db5efc0

Please sign in to comment.