Skip to content

Commit 0044608

Browse files
authored
chore: fix helm chart versioning (#76)
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
1 parent 04a84ff commit 0044608

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/env bash
22

3-
# Bump Helm Chart version, and appVersion to a given version number
3+
# Bump Helm Chart version, appVersion to a given version number
44

55
set -e
66

77
die () {
88
echo >&2 "$@"
9-
echo "usage: bump.sh [chartYamlFile] [version]"
9+
echo "usage: bump.sh [chartPath] [version]"
1010
exit 1
1111
}
1212

@@ -17,9 +17,17 @@ fi
1717

1818
[ "$#" -eq 2 ] || die "2 arguments required, $# provided"
1919

20-
chart_yaml="${1}"
21-
version="${2}"
20+
chart_yaml="${1}/Chart.yaml"
2221

22+
# Remove v prefix if provided
23+
semVer="$(echo ${2} | sed -e 's/^v\(.*\)/\1/')"
2324

24-
sed -i "s#^appVersion:.*#appVersion: ${version}#g" "${chart_yaml}"
25-
sed -i "s#^version:.*#version: ${version}#g" "${chart_yaml}"
25+
26+
# AppVersion includes a v prefix
27+
sed -i "s#^appVersion:.*#appVersion: v${semVer}#g" "${chart_yaml}"
28+
29+
# Bump chart version MINOR and reset PATCH segment
30+
# A new release means a bump in the minor segment of the Chart and a reset of the patch one
31+
# i.e 1.0.2 => 1.1.0
32+
chartVersion=$(cat ${chart_yaml} | awk -F'[ .]' '/^version:/ {print $2"."$3+1"."0}')
33+
sed -i "s#^version:.*#version: ${chartVersion}#g" "${chart_yaml}"

deployment/chainloop/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: chainloop
33
description: Chainloop is an open source software supply chain control plane, a single source of truth for artifacts plus a declarative attestation crafting process.
44

55
type: application
6-
version: v0.8.98-r1
6+
version: 1.0.2
77
appVersion: v0.8.98
88

99
dependencies:

deployment/chainloop/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This chart bootstraps a [Chainloop](https://github.com/chainloop-dev/chainloop)
1818
Deploy Chainloop in [development mode](#development) by running
1919

2020
```console
21-
helm install [RELEASE_NAME] . \
21+
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
2222
--set development=true \
2323
--set controlplane.auth.oidc.url=[OIDC URL] \
2424
--set controlplane.auth.oidc.clientID=[clientID] \
@@ -61,7 +61,7 @@ openssl ec -in private.ec.key -pubout -out public.pem
6161
Deploy Chainloop configured to talk to the bundled PostgreSQL an external OIDC IDp and a Vault instance.
6262

6363
```console
64-
helm install [RELEASE_NAME] . \
64+
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
6565
# Open ID Connect (OIDC)
6666
--set controlplane.auth.oidc.url=[OIDC URL] \
6767
--set controlplane.auth.oidc.clientID=[clientID] \
@@ -77,7 +77,7 @@ helm install [RELEASE_NAME] . \
7777
Deploy using AWS secret manager instead of Vault
7878

7979
```console
80-
helm install [RELEASE_NAME] . \
80+
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
8181
# Open ID Connect (OIDC)
8282
# ...
8383
# Secrets backend
@@ -91,7 +91,7 @@ helm install [RELEASE_NAME] . \
9191
Connect to an external PostgreSQL database instead
9292

9393
```console
94-
helm install [RELEASE_NAME] . \
94+
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
9595
# Open ID Connect (OIDC)
9696
# ...
9797
# Secrets backend
@@ -132,7 +132,7 @@ During installation, you'll need to provide
132132
Deploy by leveraging built-in Vault and PostgreSQL instances
133133

134134
```console
135-
helm install [RELEASE_NAME] . \
135+
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
136136
--set development=true \
137137
--set controlplane.auth.oidc.url=[OIDC URL] \
138138
--set controlplane.auth.oidc.clientID=[clientID] \

0 commit comments

Comments
 (0)