Skip to content

Commit 1b36520

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 1b36520

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ jobs:
7272
working-directory: image
7373
run: |
7474
ruby auto_build.rb base_release_main_${{ matrix.arch }}
75+
# Temporarily build images with PG 15 so that we can ship the changes to the postgres templates in the same PR.
76+
ruby auto_build.rb base_release_main_${{ matrix.arch }}_pg_15
7577
7678
- name: build release images for `stable` branch
7779
working-directory: image
@@ -81,6 +83,7 @@ jobs:
8183
- name: tag release images
8284
run: |
8385
docker tag discourse/base:build_release_main_${{ matrix.arch }} discourse/base:2.0.${{ env.TIMESTAMP }}-main-${{ matrix.arch }}
86+
docker tag discourse/base:build_release_main_${{ matrix.arch }}_pg_15 discourse/base:2.0.${{ env.TIMESTAMP }}-main-${{ matrix.arch }}-pg-15
8487
docker tag discourse/base:build_release_stable_${{ matrix.arch }} discourse/base:2.0.${{ env.TIMESTAMP }}-stable-${{ matrix.arch }}
8588
8689
- name: build test_build image for `main` branch
@@ -129,6 +132,7 @@ jobs:
129132
docker login --username discoursebuild --password $DOCKERHUB_PASSWORD
130133
docker push discourse/base:2.0.${{ env.TIMESTAMP }}-slim-${{ matrix.arch }}
131134
docker push discourse/base:2.0.${{ env.TIMESTAMP }}-main-${{ matrix.arch }}
135+
docker push discourse/base:2.0.${{ env.TIMESTAMP }}-main-${{ matrix.arch }}-pg-15
132136
docker push discourse/base:2.0.${{ env.TIMESTAMP }}-stable-${{ matrix.arch }}
133137
docker push discourse/discourse_dev:${{ env.TIMESTAMP }}-${{ matrix.arch }}
134138
@@ -137,7 +141,6 @@ jobs:
137141
run: |
138142
docker tag discourse/base:2.0.${{ env.TIMESTAMP }}-main-${{ matrix.arch }} discourse/base:aarch64
139143
docker push discourse/base:aarch64
140-
141144
push_multi_arch_manifests:
142145
runs-on: ubuntu-latest
143146
needs: [base, timestamp]
@@ -164,6 +167,11 @@ jobs:
164167
-a discourse/base:2.0.${{ env.TIMESTAMP }}-main-amd64 \
165168
-a discourse/base:2.0.${{ env.TIMESTAMP }}-main-arm64
166169
170+
# Full Discourse `main` branch timestamped with PG 15
171+
docker manifest create discourse/base:2.0.${{ env.TIMESTAMP }}-15 \
172+
-a discourse/base:2.0.${{ env.TIMESTAMP }}-main-amd64-pg-15 \
173+
-a discourse/base:2.0.${{ env.TIMESTAMP }}-main-arm64-pg-15
174+
167175
# Full Discourse `stable` branch timestamped
168176
docker manifest create discourse/base:2.0.${{ env.TIMESTAMP }}-stable \
169177
-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)