@@ -23,7 +23,9 @@ In order to create a new release of the `cloudnative-pg` chart, follow these ste
23
23
24
24
1 . Take note of the current value of the release: see ` .version ` in ` charts/cloudnative-pg/Chart.yaml `
25
25
``` bash
26
- yq -r ' .version' charts/cloudnative-pg/Chart.yaml
26
+ OLD_VERSION=$( yq -r ' .version' charts/cloudnative-pg/Chart.yaml)
27
+ OLD_CNPG_VERSION=$( yq -r ' .appVersion' charts/cloudnative-pg/Chart.yaml)
28
+ echo $OLD_VERSION
27
29
```
28
30
2. Decide which version to create, depending on the kind of jump of the CloudNativePG release, following semver
29
31
semantics. For this document, let' s call it `X.Y.Z`
@@ -39,36 +41,41 @@ In order to create a new release of the `cloudnative-pg` chart, follow these ste
39
41
sed -i -E "s/^version: \"([0-9]+.?)+\"/version: \"$NEW_VERSION\"/" charts/cloudnative-pg/Chart.yaml
40
42
```
41
43
5. Update everything else as required, e.g. if releasing due to a new `cloudnative-pg` version being released, you might
42
- want to update the following:
43
- 1. `.appVersion` in the [Chart.yaml](./charts/cloudnative-pg/Chart.yaml) file
44
- 2. [crds.yaml](./charts/cloudnative-pg/templates/crds/crds.yaml), which can be built using
44
+ want to:
45
+ 1. Find the latest `cloudnative-pg` version by running:
46
+ ```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
+ ```
50
+ 2. Update `.appVersion` in the [Chart.yaml](./charts/cloudnative-pg/Chart.yaml) file
51
+ ```bash
52
+ sed -i -E "s/^appVersion: \"([0-9]+.?)+\"/appVersion: \"$NEW_CNPG_VERSION\"/" charts/cloudnative-pg/Chart.yaml
53
+ ```
54
+ 3. Update [crds.yaml](./charts/cloudnative-pg/templates/crds/crds.yaml), which can be built using
45
55
[kustomize](https://kustomize.io/) from the `cloudnative-pg` repo using kustomize
46
56
[remoteBuild](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md)
47
57
running:
58
+
59
+ Verify the version is correct. Edit it if incorrect, then run:
48
60
```bash
49
- VERSION=v1.16.0
50
- kustomize build https://github.com/cloudnative-pg/cloudnative-pg/tree/release-1.16/config/helm/\?ref=v1.16.0
61
+ echo ' {{- if .Values.crds.create }}' > ./charts/cloudnative-pg/templates/crds/crds.yaml
62
+ kustomize build https://github.com/cloudnative-pg/cloudnative-pg/config/helm/\?ref\=v$NEW_CNPG_VERSION >> ./charts/cloudnative-pg/templates/crds/crds.yaml
63
+ echo ' {{- end }}' >> ./charts/cloudnative-pg/templates/crds/crds.yaml
51
64
```
52
- It might be easier to run `kustomize build config/helm` from the `cloudnative-pg` repo, with the desired release
53
- branch checked out, and copy the result to `./charts/cloudnative-pg/templates/crds/crds.yaml`.
54
- 3. NOTE: please keep the guards for `.Values.crds.create`, i.e.
55
- `{{- if .Values.crds.create }}` and `{{- end }}` after you copy the CRD into `templates/crds/crds.yaml`.
56
65
4. To update the files in the [templates](./charts/cloudnative-pg/templates) directory, you can diff the previous
57
66
CNPG release yaml against the new one, to find what should be updated (e.g.
58
67
```bash
59
- OLD_VERSION=1.15.0
60
- NEW_VERSION=1.15.1
61
68
vimdiff \
62
- "https://raw.githubusercontent. com/cloudnative-pg/cloudnative-pg/main/ releases/cnpg-${OLD_VERSION }.yaml" \
63
- "https://raw.githubusercontent. com/cloudnative-pg/cloudnative-pg/main/ releases/cnpg-${NEW_VERSION }.yaml"
69
+ "https://github. com/cloudnative-pg/cloudnative-pg/releases/download/v${OLD_CNPG_VERSION}/ cnpg-${OLD_CNPG_VERSION }.yaml" \
70
+ "https://github. com/cloudnative-pg/cloudnative-pg/releases/download/v${NEW_CNPG_VERSION}/ cnpg-${NEW_CNPG_VERSION }.yaml"
64
71
```
65
72
Or from the `cloudnative-pg` repo, with the desired release branch checked out:
66
73
```bash
67
74
vimdiff releases/cnpg-1.15.0.yaml releases/cnpg-1.15.1.yaml
68
75
```
69
- 5. Update [values.yaml](./charts/cloudnative-pg/values.yaml) if needed
70
- 6. NOTE: updating `values.yaml` just for the CNPG version may not be necessary, as the value should default to the
71
- `appVersion` in `Chart.yaml`
76
+ 5. Update [values.yaml](./charts/cloudnative-pg/values.yaml) if needed
77
+ 6. NOTE: updating `values.yaml` just for the CNPG version may not be necessary, as the value should default to the
78
+ `appVersion` in `Chart.yaml`
72
79
6. Run `make docs schema` to regenerate the docs and the values schema in case it is needed
73
80
```bash
74
81
make docs schema
0 commit comments