Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/tools/image-tag

13 lines
341 B

#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
WIP=$(git diff --quiet || echo '-WIP')
BRANCH=$(git rev-parse --abbrev-ref HEAD)
SHA=$(git rev-parse --short HEAD)
# If this is a tag, use it, otherwise branch-hash
TAG=$(git describe --exact-match 2> /dev/null || echo "${BRANCH}-${SHA}")
echo ${TAG}${WIP}