Skip to content

Commit 4c44738

Browse files
committed
Make the date part of the semver
Container images will now be called things like `8.0.23.20220527-ps-sha4567`
1 parent c35aa59 commit 4c44738

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.buildkite/hooks/pre-command

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
set -eu
22

3+
TODAY=$(date +"%Y%m%d")
4+
[ -n "$TODAY" ]
5+
echo "Today = \"${TODAY}\""
6+
37
git log -25000 --format='%H' | sort > tmp-log
48
git show-ref | grep tags/mysql-8 | sort > tmp-tags
59
export CONTAINER_SEMVER=$(join tmp-log tmp-tags | sort -t. -n -k3 | tail -1 | cut -d- -f2)
10+
[ -n "$CONTAINER_SEMVER" ]
11+
export CONTAINER_SEMVER="$CONTAINER_SEMVER.$TODAY"
612
echo "Semantic version = \"${CONTAINER_SEMVER}\""
713

814
export CONTAINER_SHORT_SHA=$(git log -1 --pretty='%h')
15+
[ -n "$CONTAINER_SHORT_SHA" ]
916
echo "Short SHA = \"${CONTAINER_SHORT_SHA}\""
1017

1118
export CONTAINER_BRANCH_NAME=$(echo "$BUILDKITE_BRANCH" | sed -e 's/[\/:]/_/g')
12-
echo "Safe branch name = \"${CONTAINER_BRANCH_NAME}\""
13-
14-
[ -n "$CONTAINER_SEMVER" ]
15-
[ -n "$CONTAINER_SHORT_SHA" ]
1619
[ -n "$CONTAINER_BRANCH_NAME" ]
20+
echo "Safe branch name = \"${CONTAINER_BRANCH_NAME}\""

0 commit comments

Comments
 (0)