Skip to content

Commit f13067c

Browse files
authored
chore(demo): add TRUNK option for deploying snapshot builds (#35)
Enable deployment of snapshot builds by running the script with `TRUNK=true`. In this mode, the latest snapshots of both CloudNativePG and the Barman Cloud plugin are used; otherwise, the latest stable releases are applied. Closes #34 Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
1 parent 469514e commit f13067c

File tree

4 files changed

+36
-13
lines changed

4 files changed

+36
-13
lines changed

demo/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ the two regions using:
3838
```
3939

4040
This process takes a few minutes to complete.
41-
It installs the latest snapshot version of CloudNativePG, cert-manager, and the
41+
It installs the latest version of CloudNativePG, cert-manager, and the
4242
[Barman Cloud plugin](https://cloudnative-pg.io/plugin-barman-cloud/),
4343
followed by the deployment of the two PostgreSQL clusters.
4444

@@ -49,6 +49,13 @@ Barman Cloud code instead of the Barman Cloud Plugin, simply run:
4949
LEGACY=true ./demo/setup.sh
5050
```
5151

52+
To deploy from the latest `main` branch of both CloudNativePG and the Barman
53+
Cloud plugin, use:
54+
55+
```bash
56+
TRUNK=true ./demo/setup.sh
57+
```
58+
5259
For a detailed understanding of the deployment process, refer to the
5360
[`setup.sh` script](setup.sh).
5461

demo/setup.sh

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ if [ "${LEGACY:-}" = "true" ]; then
3434
legacy="-legacy"
3535
fi
3636

37+
trunk=0
38+
if [ "${TRUNK:-}" = "true" ]; then
39+
trunk=1
40+
fi
41+
3742
# Ensure prerequisites are met
3843
prereqs="kubectl kubectl-cnpg cmctl"
3944
for cmd in $prereqs; do
@@ -50,11 +55,17 @@ export KUBECONFIG=${kube_config_path}
5055
# Begin deployment, one region at a time
5156
for region in eu us; do
5257

53-
# Deploy CloudNativePG operator (latest version, through the plugin)
54-
#kubectl cnpg install generate --control-plane | \
55-
curl -sSfL \
56-
https://raw.githubusercontent.com/cloudnative-pg/artifacts/main/manifests/operator-manifest.yaml | \
57-
kubectl --context kind-k8s-${region} apply -f - --server-side
58+
if [ $trunk -eq 1 ]
59+
then
60+
# Deploy CloudNativePG operator (trunk - main branch)
61+
curl -sSfL \
62+
https://raw.githubusercontent.com/cloudnative-pg/artifacts/main/manifests/operator-manifest.yaml | \
63+
kubectl --context kind-k8s-${region} apply -f - --server-side
64+
else
65+
# Deploy CloudNativePG operator (latest version, through the plugin)
66+
kubectl cnpg install generate --control-plane | \
67+
kubectl --context kind-k8s-${region} apply -f - --server-side
68+
fi
5869

5970
# Wait for CNPG deployment to complete
6071
kubectl --context kind-k8s-${region} rollout status deployment \
@@ -69,11 +80,16 @@ for region in eu us; do
6980
-n cert-manager
7081
cmctl check api --wait=2m --context kind-k8s-${region}
7182

72-
# Deploy Barman Cloud Plugin
73-
#kubectl apply --context kind-k8s-${region} -f \
74-
# https://github.com/cloudnative-pg/plugin-barman-cloud/releases/latest/download/manifest.yaml
75-
kubectl apply --context kind-k8s-${region} -f \
76-
https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml
83+
if [ $trunk -eq 1 ]
84+
then
85+
# Deploy Barman Cloud Plugin (trunk)
86+
kubectl apply --context kind-k8s-${region} -f \
87+
https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml
88+
else
89+
# Deploy Barman Cloud Plugin (latest stable)
90+
kubectl apply --context kind-k8s-${region} -f \
91+
https://github.com/cloudnative-pg/plugin-barman-cloud/releases/latest/download/manifest.yaml
92+
fi
7793

7894
# Wait for Barman Cloud Plugin deployment to complete
7995
kubectl rollout --context kind-k8s-${region} status deployment \

demo/yaml/eu/pg-eu-legacy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: pg-eu
55
spec:
66
instances: 3
7-
imageName: ghcr.io/cloudnative-pg/postgresql:17-bookworm
7+
imageName: ghcr.io/cloudnative-pg/postgresql:17-system-trixie
88

99
storage:
1010
size: 1Gi

demo/yaml/eu/pg-eu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: pg-eu
55
spec:
66
instances: 3
7-
imageName: ghcr.io/cloudnative-pg/postgresql:17-standard-bookworm
7+
imageName: ghcr.io/cloudnative-pg/postgresql:17-standard-trixie
88

99
storage:
1010
size: 1Gi

0 commit comments

Comments
 (0)