Skip to content

Commit 8742f44

Browse files
committed
Retire the bare preset tag
It moved with every build exactly like the new -latest tag, so builds carried two tags meaning the same thing. Leaves one moving tag and one per-commit tag.
1 parent 3a72b11 commit 8742f44

3 files changed

Lines changed: 9 additions & 15 deletions

File tree

.github/workflows/build-seeded-databases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
DB="${MATRIX_DATABASE}"
169169
SHA_SHORT="${GITHUB_SHA:0:7}"
170170
docker save \
171-
"${_AZ_REGISTRY}/shot/seeded-${DB}:${TAG}" \
171+
"${_AZ_REGISTRY}/shot/seeded-${DB}:${TAG}-latest" \
172172
"${_AZ_REGISTRY}/shot/seeded-${DB}:${TAG}-${SHA_SHORT}" \
173173
-o "seeded-${DB}-${TAG}-${SHA_SHORT}.tar"
174174

util/SeederUtility/scripts/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ dotnet run --project .. -- preset --list --output json
4040

4141
Each build produces two tags:
4242

43-
- **Stable**: `seeded-{db}:{preset-name}` — e.g. `seeded-postgres:qa-dunder-mifflin-enterprise-full`
44-
- **Versioned**: `seeded-{db}:{preset-name}-{git-sha}` — e.g. `seeded-postgres:qa-dunder-mifflin-enterprise-full-abc1234`
43+
- **Latest**: `seeded-{db}:{preset-name}-latest` — e.g. `seeded-postgres:qa-dunder-mifflin-enterprise-full-latest`. Moves with every build.
44+
- **Versioned**: `seeded-{db}:{preset-name}-{git-sha}` — e.g. `seeded-postgres:qa-dunder-mifflin-enterprise-full-abc1234`. Immutable, so a deployment can pin a known build.
4545

4646
Either tag works with any core bundle, because CI pins one data protection key for every build.
4747

@@ -68,7 +68,7 @@ Start the database and point the application at the unpacked bundle:
6868

6969
```bash
7070
docker run -d -p 5432:5432 \
71-
bitwardenprod.azurecr.io/shot/seeded-postgres:qa-dunder-mifflin-enterprise-full
71+
bitwardenprod.azurecr.io/shot/seeded-postgres:qa-dunder-mifflin-enterprise-full-latest
7272
```
7373

7474
The seed runs on first boot for postgres, mysql, and mariadb, so the server accepts connections before the data is loaded. Poll for a seeded table rather than trusting `pg_isready`:
@@ -151,7 +151,7 @@ Start the database on a named network:
151151

152152
```bash
153153
docker network create bwlite
154-
docker run -d --name bwlite-db --network bwlite -p 5433:5432 bitwardenprod.azurecr.io/shot/seeded-postgres:scale-lg-balanced-wayne-enterprises
154+
docker run -d --name bwlite-db --network bwlite -p 5433:5432 bitwardenprod.azurecr.io/shot/seeded-postgres:scale-lg-balanced-wayne-enterprises-latest
155155
```
156156

157157
Start lite against it:
@@ -190,7 +190,7 @@ Swap the database in `bwdata/docker/docker-compose.override.yml`, which `run.sh`
190190
```yaml
191191
services:
192192
mssql:
193-
image: bitwardenprod.azurecr.io/shot/seeded-mssql:qa-dunder-mifflin-enterprise-full
193+
image: bitwardenprod.azurecr.io/shot/seeded-mssql:qa-dunder-mifflin-enterprise-full-latest
194194
```
195195
196196
To pull that image, run `az acr login -n bitwardenprod` first. The registry refuses anonymous pulls, and `run.sh` runs `docker compose pull` on every start.
@@ -257,7 +257,7 @@ database:
257257
type: postgres # or mariadb, sqlserver
258258
image:
259259
repository: bitwardenprod.azurecr.io/shot/seeded-postgres
260-
tag: qa-dunder-mifflin-enterprise-full
260+
tag: qa-dunder-mifflin-enterprise-full-latest
261261
```
262262

263263
### Self-host chart
@@ -268,7 +268,7 @@ self-host:
268268
database:
269269
image:
270270
name: bitwardenprod.azurecr.io/shot/seeded-mssql
271-
tag: qa-dunder-mifflin-enterprise-full
271+
tag: qa-dunder-mifflin-enterprise-full-latest
272272
```
273273

274274
**Note**: Both charts also need the [core bundle](#core-bundle) unpacked at `/etc/bitwarden/core`. Login fails against seeded data without the data protection key.

util/SeederUtility/scripts/build-seeded-image.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ esac
6262
# Sanitize preset name for Docker tag + container name: replace dots with dashes
6363
TAG="${PRESET_NAME//./-}"
6464
IMAGE_REPO="${REGISTRY}/shot/seeded-${DB_TYPE}"
65-
IMAGE_STABLE="${IMAGE_REPO}:${TAG}"
6665
IMAGE_VERSIONED="${IMAGE_REPO}:${TAG}-${GIT_SHA}"
6766
IMAGE_LATEST="${IMAGE_REPO}:${TAG}-latest"
6867

@@ -85,7 +84,6 @@ trap cleanup EXIT
8584
PRESET_CATEGORY="${PRESET_NAME%%.*}"
8685

8786
echo "==> Building seeded ${DB_TYPE} image for preset: ${PRESET_NAME}"
88-
echo " Stable: ${IMAGE_STABLE}"
8987
echo " Versioned: ${IMAGE_VERSIONED}"
9088
echo " Latest: ${IMAGE_LATEST}"
9189
echo " Git SHA: ${GIT_SHA}"
@@ -112,29 +110,25 @@ _docker_build_and_push() {
112110
--build-arg "PRESET_CATEGORY=${PRESET_CATEGORY}" \
113111
--build-arg "GIT_SHA=${GIT_SHA}" \
114112
--build-arg "BUILD_DATE=${BUILD_DATE}" \
115-
-t "${IMAGE_STABLE}" \
116113
-t "${IMAGE_VERSIONED}" \
117114
-t "${IMAGE_LATEST}" \
118115
"${WORK_DIR}" \
119116
--load
120117

121-
echo "==> Built: ${IMAGE_STABLE}"
122118
echo "==> Built: ${IMAGE_VERSIONED}"
123119
echo "==> Built: ${IMAGE_LATEST}"
124120

125121
if [[ "${PUSH}" == "true" ]]; then
126122
# Caller is responsible for registry auth (e.g. `az acr login` in CI or
127123
# locally) before invoking with PUSH=true.
128124
echo "==> Pushing images"
129-
docker push "${IMAGE_STABLE}"
130125
docker push "${IMAGE_VERSIONED}"
131126
docker push "${IMAGE_LATEST}"
132-
echo "==> Pushed: ${IMAGE_STABLE}"
133127
echo "==> Pushed: ${IMAGE_VERSIONED}"
134128
echo "==> Pushed: ${IMAGE_LATEST}"
135129

136130
# free up disk after push
137-
docker rmi "${IMAGE_STABLE}" "${IMAGE_VERSIONED}" "${IMAGE_LATEST}" >/dev/null 2>&1 || true
131+
docker rmi "${IMAGE_VERSIONED}" "${IMAGE_LATEST}" >/dev/null 2>&1 || true
138132
fi
139133
}
140134

0 commit comments

Comments
 (0)