Skip to content

Commit aecc757

Browse files
committed
docs: add plugin-barman-cloud chart release instructions
Signed-off-by: Marco Nenciarini <[email protected]>
1 parent 3a88b82 commit aecc757

File tree

1 file changed

+94
-4
lines changed

1 file changed

+94
-4
lines changed

RELEASE.md

Lines changed: 94 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ release (e.g. 1.17.1)
1515
## Charts
1616

1717
1. [Releasing the `cloudnative-pg` chart](#releasing-the-cloudnative-pg-chart)
18-
2. [Releasing `cluster` chart](#releasing-the-cluster-chart)
18+
2. [Releasing the `cluster` chart](#releasing-the-cluster-chart)
19+
3. [Releasing the `plugin-barman-cloud` chart](#releasing-the-plugin-barman-cloud)
1920

2021
## Releasing the `cloudnative-pg` chart
2122

@@ -25,7 +26,8 @@ In order to create a new release of the `cloudnative-pg` chart, follow these ste
2526
```bash
2627
OLD_VERSION=$(yq -r '.version' charts/cloudnative-pg/Chart.yaml)
2728
OLD_CNPG_VERSION=$(yq -r '.appVersion' charts/cloudnative-pg/Chart.yaml)
28-
echo $OLD_VERSION
29+
echo Old chart version: $OLD_VERSION
30+
echo Old CNPG version: $OLD_CNPG_VERSION
2931
```
3032
2. Decide which version to create, depending on the kind of jump of the CloudNativePG release, following semver
3133
semantics. For this document, let's call it `X.Y.Z`
@@ -44,8 +46,8 @@ In order to create a new release of the `cloudnative-pg` chart, follow these ste
4446
want to:
4547
1. Find the latest `cloudnative-pg` version by running:
4648
```bash
47-
NEW_CNPG_VERSION=$(curl "https://api.github.com/repos/cloudnative-pg/cloudnative-pg/tags" | jq -r '.[0].name | ltrimstr("v")')
48-
echo $NEW_CNPG_VERSION
49+
NEW_CNPG_VERSION=$(curl -Ssl "https://api.github.com/repos/cloudnative-pg/cloudnative-pg/tags" | jq -r '.[0].name | ltrimstr("v")')
50+
echo New CNPG version: $NEW_CNPG_VERSION
4951
```
5052
2. Update `.appVersion` in the [Chart.yaml](./charts/cloudnative-pg/Chart.yaml) file
5153
```bash
@@ -155,3 +157,91 @@ In order to create a new release of the `cluster` chart, follow these steps:
155157
helm search repo cnpg
156158
```
157159
and be able to see the new version `X.Y.Z` as `CHART VERSION` for `cluster`
160+
161+
## Releasing the `plugin-barman-cloud` chart
162+
163+
In order to create a new release of the `plugin-barman-cloud` chart, follow these steps:
164+
165+
1. Take note of the current value of the release: see `.version` in `charts/plugin-barman-cloud/Chart.yaml`
166+
```bash
167+
OLD_VERSION=$(yq -r '.version' charts/plugin-barman-cloud/Chart.yaml)
168+
OLD_APP_VERSION=$(yq -r '.appVersion' charts/plugin-barman-cloud/Chart.yaml)
169+
echo Old chart version: $OLD_VERSION
170+
echo Old app version: $OLD_APP_VERSION
171+
```
172+
2. Decide which version to create, depending on the kind of jump of the CloudNativePG release, following semver
173+
semantics. For this document, let's call it `X.Y.Z`
174+
```bash
175+
NEW_VERSION="X.Y.Z"
176+
```
177+
3. Create a branch named `release/plugin-barman-cloud-vX.Y.Z` and switch to it:
178+
```bash
179+
git switch --create release/plugin-barman-cloud-v$NEW_VERSION
180+
```
181+
4. Update the `.version` in the [Chart.yaml](./charts/plugin-barman-cloud/Chart.yaml) file to `"X.Y.Z"`
182+
```bash
183+
sed -i -E "s/^version: \"([0-9]+.?)+\"/version: \"$NEW_VERSION\"/" charts/plugin-barman-cloud/Chart.yaml
184+
```
185+
5. Update everything else as required, e.g. if releasing due to a new `plugin-barman-cloud` version being released, you might
186+
want to:
187+
1. Find the latest `plugin-barman-cloud` version by running:
188+
```bash
189+
NEW_APP_VERSION=$(curl -Ssl "https://api.github.com/repos/cloudnative-pg/plugin-barman-cloud/tags" | jq -r '.[0].name')
190+
echo New app version: $NEW_APP_VERSION
191+
```
192+
2. Update `.appVersion` in the [Chart.yaml](./charts/plugin-barman-cloud/Chart.yaml) file
193+
```bash
194+
sed -i -E "s/^appVersion: \"v([0-9]+.?)+\"/appVersion: \"$NEW_APP_VERSION\"/" charts/plugin-barman-cloud/Chart.yaml
195+
```
196+
3. Update [crds.yaml](./charts/plugin-barman-cloud/templates/crds/crds.yaml), which can be built using
197+
[kustomize](https://kustomize.io/) from the `plugin-barman-cloud` repo using kustomize
198+
[remoteBuild](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md)
199+
running:
200+
201+
Verify the version is correct. Edit it if incorrect, then run:
202+
```bash
203+
echo '{{- if .Values.crds.create }}' > ./charts/plugin-barman-cloud/templates/crds/crds.yaml
204+
kustomize build https://github.com/cloudnative-pg/plugin-barman-cloud/config/crd/\?ref\=$NEW_APP_VERSION >> ./charts/plugin-barman-cloud/templates/crds/crds.yaml
205+
echo '{{- end }}' >> ./charts/plugin-barman-cloud/templates/crds/crds.yaml
206+
```
207+
208+
Check that the `helm.sh/resource-policy: keep` annotation is still present after regenerating the CRDs.
209+
4. To update the files in the [templates](./charts/plugin-barman-cloud/templates) directory, you can diff the previous
210+
CNPG release yaml against the new one, to find what should be updated (e.g.
211+
```bash
212+
vimdiff \
213+
"https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/${OLD_APP_VERSION}/manifest.yaml" \
214+
"https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/${NEW_APP_VERSION}/manifest.yaml"
215+
```
216+
217+
5. Update [values.yaml](./charts/plugin-barman-cloud/values.yaml) if needed
218+
6. NOTE: updating `values.yaml` just for the appVersion may not be necessary, as the value should default to the
219+
`appVersion` in `Chart.yaml`
220+
6. Run `make docs schema` to regenerate the docs and the values schema in case it is needed
221+
```bash
222+
make docs schema
223+
```
224+
7. Commit and add the relevant information you wish in the commit message.
225+
```bash
226+
git add .
227+
git commit -S -s -m "Release plugin-barman-cloud-v$NEW_VERSION" --edit
228+
```
229+
8. Push the new branch
230+
```bash
231+
git push --set-upstream origin release/plugin-barman-cloud-v$NEW_VERSION
232+
```
233+
9. A PR named `Release plugin-barman-cloud-vX.Y.Z` should be automatically created
234+
10. Wait for all the checks to pass
235+
11. Two approvals are required in order to merge the PR, if you are a maintainer approve the PR yourself and ask for
236+
another approval, otherwise ask for two approvals directly.
237+
12. Merge the PR squashing all commits and **taking care to keep the commit message to be
238+
`Release plugin-barman-cloud-vX.Y.Z`**
239+
13. A release `plugin-barman-cloud-vX.Y.Z` should be automatically created by an action, which will then trigger the release
240+
action. Verify they both are successful.
241+
14. Once done you should be able to run:
242+
```bash
243+
helm repo add cnpg https://cloudnative-pg.github.io/charts
244+
helm repo update
245+
helm search repo cnpg
246+
```
247+
and be able to see the new version `X.Y.Z` as `CHART VERSION` for `plugin-barman-cloud`

0 commit comments

Comments
 (0)