Publish portable nextcloud-whiteboard chart
Validate, publish and promote nextcloud-whiteboard chart / chart (push) Successful in 34s
Validate, publish and promote nextcloud-whiteboard chart / chart (push) Successful in 34s
This commit is contained in:
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
description=$(git -C "$repo_dir" describe --tags --long --dirty)
|
||||
case "$description" in
|
||||
*-dirty) echo 'Refusing to package a dirty tree.' >&2; exit 1 ;;
|
||||
esac
|
||||
if [[ "$description" =~ ^(.+)-([0-9]+)-g([0-9a-f]+)$ ]]; then
|
||||
release_tag=${BASH_REMATCH[1]}
|
||||
count=${BASH_REMATCH[2]}
|
||||
hash=${BASH_REMATCH[3]}
|
||||
else
|
||||
echo "Unexpected git describe result: $description" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$release_tag" in
|
||||
v[0-9]*)
|
||||
version=${release_tag#v}
|
||||
;;
|
||||
[0-9]*_[0-9]*)
|
||||
date=${release_tag%%_*}
|
||||
time=${release_tag#*_}
|
||||
version="${date}.0.0-r${time}"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported application release tag: $release_tag" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
if [ "$count" -ne 0 ]; then
|
||||
version="$version-$count-g$hash"
|
||||
fi
|
||||
printf '%s\n' "$version"
|
||||
Reference in New Issue
Block a user