release 1.3.0: sticky bar suite version + Forgejo tag link
This commit is contained in:
parent
9eac6e58b4
commit
db8b474d39
6 changed files with 121 additions and 2 deletions
|
|
@ -39,6 +39,33 @@ COMMIT_SHORT=$(git rev-parse --short=12 HEAD)
|
|||
SOURCE_REPO_WEB="${SOURCE_REPO_WEB:-https://git.hacktivism.ch/hernani/taler-monitoring}"
|
||||
COMMIT_URL="${SOURCE_REPO_WEB}/src/commit/${COMMIT}"
|
||||
export COMMIT COMMIT_SHORT COMMIT_URL SOURCE_REPO_WEB
|
||||
|
||||
# Release tag for sticky bar (exact tag if HEAD is tagged, else nearest)
|
||||
SUITE_VERSION=""
|
||||
if command -v git >/dev/null 2>&1; then
|
||||
SUITE_VERSION=$(git describe --tags --exact-match 2>/dev/null || true)
|
||||
if [ -z "$SUITE_VERSION" ]; then
|
||||
SUITE_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || true)
|
||||
fi
|
||||
fi
|
||||
if [ -z "$SUITE_VERSION" ] && [ -f "$SUITE_DIR/VERSION" ]; then
|
||||
SUITE_VERSION="v$(tr -d '[:space:]' <"$SUITE_DIR/VERSION" | sed 's/^v//')"
|
||||
case "$SUITE_VERSION" in v*) ;; *) SUITE_VERSION="v${SUITE_VERSION#v}" ;; esac
|
||||
fi
|
||||
[ -z "$SUITE_VERSION" ] && SUITE_VERSION="unknown"
|
||||
# normalize: ensure leading v for tags
|
||||
case "$SUITE_VERSION" in
|
||||
unknown) ;;
|
||||
v*) ;;
|
||||
*) SUITE_VERSION="v${SUITE_VERSION}" ;;
|
||||
esac
|
||||
SUITE_VERSION_URL=""
|
||||
if [ -n "$SOURCE_REPO_WEB" ] && [ "$SUITE_VERSION" != "unknown" ]; then
|
||||
SUITE_VERSION_URL="${SOURCE_REPO_WEB}/src/tag/${SUITE_VERSION}"
|
||||
fi
|
||||
export SUITE_VERSION SUITE_VERSION_URL
|
||||
echo " version=$SUITE_VERSION ${SUITE_VERSION_URL:+· $SUITE_VERSION_URL}"
|
||||
|
||||
echo "suite @ $COMMIT_SHORT $COMMIT_URL"
|
||||
echo " dir=$SUITE_DIR"
|
||||
ln -sfn "$SUITE_DIR" "$HOME/taler-monitoring" 2>/dev/null || true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue