Skip to content

Commit 7ba203d

Browse files
ci: propagate updates to legacy system catalogs (#308)
Closes #307 Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com> Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
1 parent c919540 commit 7ba203d

2 files changed

Lines changed: 60 additions & 1 deletion

File tree

.github/workflows/catalogs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2020
with:
2121
path: postgres-containers
22+
token: ${{ secrets.REPO_GHA_PAT }}
2223

2324
- name: Checkout artifacts
2425
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
@@ -41,6 +42,14 @@ jobs:
4142
run: |
4243
python postgres-containers/.github/catalogs_generator.py --output-dir artifacts/image-catalogs/
4344
45+
# TODO: remove this step once system images are EOL
46+
- name: Update legacy catalogs
47+
run: |
48+
cp artifacts/image-catalogs/catalog-system-bullseye.yaml postgres-containers/Debian/ClusterImageCatalog-bullseye.yaml
49+
cp artifacts/image-catalogs/catalog-system-bookworm.yaml postgres-containers/Debian/ClusterImageCatalog-bookworm.yaml
50+
yq -i '.metadata.name = "postgresql"' postgres-containers/Debian/ClusterImageCatalog-bullseye.yaml
51+
yq -i '.metadata.name = "postgresql"' postgres-containers/Debian/ClusterImageCatalog-bookworm.yaml
52+
4453
- name: Diff
4554
working-directory: artifacts
4655
run: |
@@ -56,3 +65,40 @@ jobs:
5665
author_name: CloudNativePG Automated Updates
5766
author_email: noreply@cnpg.com
5867
message: 'chore: update imageCatalogs'
68+
69+
# TODO: remove this step once system images are EOL
70+
- name: Temporarily disable "include administrators" branch protection
71+
if: ${{ always() && github.ref == 'refs/heads/main' }}
72+
id: disable_include_admins
73+
uses: benjefferies/branch-protection-bot@af281f37de86139d1c7a27b91176b5dc1c2c827c # v1.1.2
74+
with:
75+
access_token: ${{ secrets.REPO_GHA_PAT }}
76+
branch: main
77+
enforce_admins: false
78+
79+
# TODO: remove this step once system images are EOL
80+
- name: Legacy diff
81+
working-directory: postgres-containers
82+
run: |
83+
git add -A .
84+
git status
85+
git diff --staged
86+
87+
# TODO: remove this step once system images are EOL
88+
- uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9
89+
if: ${{ github.ref == 'refs/heads/main' }}
90+
with:
91+
cwd: 'postgres-containers'
92+
add: 'Debian/*.yaml'
93+
author_name: CloudNativePG Automated Updates
94+
author_email: noreply@cnpg.com
95+
message: 'chore: update imageCatalogs'
96+
97+
# TODO: remove this step once system images are EOL
98+
- name: Enable "include administrators" branch protection
99+
uses: benjefferies/branch-protection-bot@af281f37de86139d1c7a27b91176b5dc1c2c827c # v1.1.2
100+
if: ${{ always() && github.ref == 'refs/heads/main' }}
101+
with:
102+
access_token: ${{ secrets.REPO_GHA_PAT }}
103+
branch: main
104+
enforce_admins: ${{ steps.disable_include_admins.outputs.initial_status }}

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
> In response, the CloudNativePG project has completed the transition to the
77
> new `bake`-based build process for all `system` images. We now build directly
88
> on top of the official Debian slim images, fully detaching from the official
9-
> Postgres image. Additional changes are planned as part of epic #287.
9+
> Postgres image.
1010
1111
---
1212

@@ -169,6 +169,19 @@ tags:
169169
tag formats that explicitly include both the **image type** and the
170170
**distribution version** (e.g. `16.10-minimal-trixie`).
171171

172+
## Image Catalogs
173+
174+
CloudNativePG publishes `ClusterImageCatalog` manifests for CloudNativePG in
175+
the [`artifacts` repository](https://github.com/cloudnative-pg/artifacts/tree/main/image-catalogs),
176+
with one catalog available for each supported combination of image type and
177+
operating system version.
178+
179+
**IMPORTANT:** If you are still relying on the legacy
180+
[`ClusterImageCatalog-bullseye.yaml`](Debian/ClusterImageCatalog-bullseye.yaml)
181+
and [`ClusterImageCatalog-bookworm.yaml`](Debian/ClusterImageCatalog-bookworm.yaml)
182+
manifests, please migrate to the new catalogs as soon as possible. These legacy
183+
manifests are deprecated and will be removed along with the `system` image.
184+
172185
## Build Attestations
173186

174187
CNPG PostgreSQL Container Images are built with the following attestations to

0 commit comments

Comments
 (0)