Skip to content

Commit 8f443b2

Browse files
committed
Build images with PG 15 installed
This commit updates the build workflow to build and push an extra base Docker image with PG 15 installed. The tag is not meant to be permanent and is just meant to help us update our postgres templates to support PG 15 within the same commit. The tag will be removed once our `discourse/base:release` ships with PG 15 by default.
1 parent 136c638 commit 8f443b2

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ jobs:
4949
with:
5050
fetch-depth: 1
5151

52-
- name: build deps image
53-
working-directory: image
54-
run: |
55-
ruby auto_build.rb base_deps_${{ matrix.arch }}
56-
5752
- name: build slim image for `main` branch
5853
working-directory: image
5954
run: |
@@ -72,6 +67,8 @@ jobs:
7267
working-directory: image
7368
run: |
7469
ruby auto_build.rb base_release_main_${{ matrix.arch }}
70+
# Temporarily build images with PG 15 so that we can ship the changes to the postgres templates in the same PR.
71+
ruby auto_build.rb base_release_main_${{ matrix.arch }}_pg_15
7572
7673
- name: build release images for `stable` branch
7774
working-directory: image
@@ -81,6 +78,7 @@ jobs:
8178
- name: tag release images
8279
run: |
8380
docker tag discourse/base:build_release_main_${{ matrix.arch }} discourse/base:2.0.${{ env.TIMESTAMP }}-main-${{ matrix.arch }}
81+
docker tag discourse/base:build_release_main_${{ matrix.arch }}_pg_15 discourse/base:2.0.${{ env.TIMESTAMP }}-main-${{ matrix.arch }}-pg-15
8482
docker tag discourse/base:build_release_stable_${{ matrix.arch }} discourse/base:2.0.${{ env.TIMESTAMP }}-stable-${{ matrix.arch }}
8583
8684
- name: build test_build image for `main` branch
@@ -129,6 +127,7 @@ jobs:
129127
docker login --username discoursebuild --password $DOCKERHUB_PASSWORD
130128
docker push discourse/base:2.0.${{ env.TIMESTAMP }}-slim-${{ matrix.arch }}
131129
docker push discourse/base:2.0.${{ env.TIMESTAMP }}-main-${{ matrix.arch }}
130+
docker push discourse/base:2.0.${{ env.TIMESTAMP }}-main-${{ matrix.arch }}-pg-15
132131
docker push discourse/base:2.0.${{ env.TIMESTAMP }}-stable-${{ matrix.arch }}
133132
docker push discourse/discourse_dev:${{ env.TIMESTAMP }}-${{ matrix.arch }}
134133
@@ -137,7 +136,6 @@ jobs:
137136
run: |
138137
docker tag discourse/base:2.0.${{ env.TIMESTAMP }}-main-${{ matrix.arch }} discourse/base:aarch64
139138
docker push discourse/base:aarch64
140-
141139
push_multi_arch_manifests:
142140
runs-on: ubuntu-latest
143141
needs: [base, timestamp]
@@ -164,6 +162,11 @@ jobs:
164162
-a discourse/base:2.0.${{ env.TIMESTAMP }}-main-amd64 \
165163
-a discourse/base:2.0.${{ env.TIMESTAMP }}-main-arm64
166164
165+
# Full Discourse `main` branch timestamped with PG 15
166+
docker manifest create discourse/base:2.0.${{ env.TIMESTAMP }}-15 \
167+
-a discourse/base:2.0.${{ env.TIMESTAMP }}-main-amd64-pg-15 \
168+
-a discourse/base:2.0.${{ env.TIMESTAMP }}-main-arm64-pg-15
169+
167170
# Full Discourse `stable` branch timestamped
168171
docker manifest create discourse/base:2.0.${{ env.TIMESTAMP }}-stable \
169172
-a discourse/base:2.0.${{ env.TIMESTAMP }}-stable-amd64 \

image/auto_build.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,27 @@
4343
extra_args: "--build-arg=\"DISCOURSE_BRANCH=main\" --target discourse_release",
4444
use_cache: true,
4545
},
46+
base_release_main_amd64_pg_15: {
47+
name: "base",
48+
tag: "discourse/base:build_release_main_amd64_pg_15",
49+
extra_args:
50+
"--build-arg=\"DISCOURSE_BRANCH=main\" --target discourse_release --build-arg PG_MAJOR=15",
51+
use_cache: true,
52+
},
4653
base_release_main_arm64: {
4754
name: "base",
4855
tag: "discourse/base:build_release_main_arm64",
4956
extra_args:
5057
"--platform linux/arm64 --build-arg=\"DISCOURSE_BRANCH=main\" --target discourse_release",
5158
use_cache: true,
5259
},
60+
base_release_main_arm64_pg_15: {
61+
name: "base",
62+
tag: "discourse/base:build_release_main_arm64_pg_15",
63+
extra_args:
64+
"--build-arg=\"DISCOURSE_BRANCH=main\" --target discourse_release --build-arg PG_MAJOR=15",
65+
use_cache: true,
66+
},
5367
base_release_stable_amd64: {
5468
name: "base",
5569
tag: "discourse/base:build_release_stable_amd64",

image/base/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ RUN gpg --import /tmp/nginx_public_keys.key &&\
2828
FROM discourse/ruby:3.3.6-${DEBIAN_RELEASE}-slim AS discourse_dependencies
2929

3030
ARG DEBIAN_RELEASE
31-
ENV PG_MAJOR=13 \
31+
ARG PG_MAJOR=13
32+
ENV PG_MAJOR=${PG_MAJOR} \
3233
RUBY_ALLOCATOR=/usr/lib/libjemalloc.so \
3334
LEFTHOOK=0 \
3435
DEBIAN_RELEASE=${DEBIAN_RELEASE}

0 commit comments

Comments
 (0)