Skip to content

Commit cc26e9d

Browse files
committed
Use N.N.NN-ps-SHA4567 container names
The main branch gets pushed as e.g. 8.0.28-ps-123abcd. Other branches get pushed as e.g. 8.0.28-ps-123abcd-piki_fix-things.
1 parent b0a7989 commit cc26e9d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.buildkite/hooks/pre-command

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
set -eu
2+
3+
git log -25000 --format='%H' | sort > tmp-log
4+
git show-ref | grep tags/mysql-8 | sort > tmp-tags
5+
export CONTAINER_SEMVER=$(join tmp-log tmp-tags | sort -k2 | tail -1 | cut -d- -f2)
6+
echo "Semantic version = \"${CONTAINER_SEMVER}\""
7+
8+
export CONTAINER_SHORT_SHA=$(git log -1 --pretty='%h')
9+
echo "Short SHA = \"${CONTAINER_SHORT_SHA}\""
10+
11+
export CONTAINER_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD | sed -e 's/[\/:]/_/g')
12+
echo "Safe branch name = \"${CONTAINER_BRANCH_NAME}\""

.buildkite/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ steps:
3333
- docker-compose#v3.9.0:
3434
run: release
3535
push:
36-
- "release:${REGISTRY}/branch/${IMAGE_NAME}:${BUILDKITE_BRANCH}-latest"
36+
- "release:${REGISTRY}/branch/${IMAGE_NAME}:${CONTAINER_SEMVER}-ps-${CONTAINER_SHORT_SHA}-${CONTAINER_BRANCH_NAME}"
3737

3838
- name: "Build runtime mysql-server container for main"
3939
label: ":docker: Build runtime main container"
@@ -47,4 +47,4 @@ steps:
4747
- docker-compose#v3.9.0:
4848
run: release
4949
push:
50-
- "release:${REGISTRY}/main/${IMAGE_NAME}:${BUILDKITE_BRANCH}-latest"
50+
- "release:${REGISTRY}/main/${IMAGE_NAME}:${CONTAINER_SEMVER}-ps-${CONTAINER_SHORT_SHA}"

0 commit comments

Comments
 (0)