Skip to content

Commit e964b38

Browse files
authored
Merge pull request mysql#9 from planetscale/piki/container-names
Use `$semver-ps-$sha` container names
2 parents b0a7989 + 3ba14ae commit e964b38

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
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=$(echo "$BUILDKITE_BRANCH" | 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}"

_planetscale/docs/registry.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ aws --region us-east-1 ecr list-images --profile build --repository-name 'branch
1212
```
1313

1414
If necessary, log into the [`build` profile](https://github.com/planetscale/infra/blob/12ae46f94b7b9ad15b0b1ef00c94d544e590c42f/aws_config#L57-L61) first:
15+
1516
```
1617
aws sso login --profile build
1718
```
19+
20+
### Run images
21+
22+
To run a MySQL container image locally, first log in if needed:
23+
24+
```
25+
aws sso login
26+
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 997601596833.dkr.ecr.us-east-1.amazonaws.com
27+
```
28+
29+
And then run it:
30+
31+
```
32+
docker run -it 997601596833.dkr.ecr.us-east-1.amazonaws.com/branch/mysql-server:8.0.28-ps-sha4567
33+
```

build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ cmake \
2727
-DWITH_NUMA=ON \
2828
.. && \
2929
make -j $(nproc) && \
30-
make test ARGS="-j $(nproc)" && \
3130
make package -j $(nproc)
3231

3332
cp *.tar.gz /dist/

0 commit comments

Comments
 (0)