Skip to content

Commit b74377c

Browse files
ElderMattmerll
andauthored
fix: check for helm secrets version and update it (#1927)
Co-authored-by: Matthias Erll <[email protected]>
1 parent 7d8bf90 commit b74377c

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

bin/install-deps.sh

+19-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,26 @@ go install github.com/noqcks/gucci@latest
44
go install github.com/plexsystems/konstraint@latest
55
npm install -g json-dereference-cli
66

7+
# Desired version
8+
helm_secrets_target_version="4.6.2"
9+
10+
# Get the installed version of helm-secrets
11+
helm_secrets_installed_version=$(helm plugin list | awk '/secrets/ {print $2}')
12+
13+
# Compare versions and update if necessary
14+
if [ -z "$helm_secrets_installed_version" ]; then
15+
echo "helm-secrets is not installed. Installing version $helm_secrets_target_version..."
16+
helm plugin install https://github.com/jkroepke/helm-secrets --version "$helm_secrets_target_version"
17+
elif [ "$(printf '%s\n' "$helm_secrets_installed_version" "$helm_secrets_target_version" | sort -V | head -n1)" != "$helm_secrets_target_version" ]; then
18+
echo "Updating helm-secrets from version $helm_secrets_installed_version to $helm_secrets_target_version..."
19+
helm plugin uninstall secrets
20+
helm plugin install https://github.com/jkroepke/helm-secrets --version "$helm_secrets_target_version"
21+
else
22+
echo "helm-secrets is up-to-date (version $helm_secrets_installed_version)."
23+
fi
24+
725
helm plugin install https://github.com/databus23/helm-diff.git || echo "Skipping helm-diff"
8-
helm plugin install https://github.com/jkroepke/helm-secrets.git --version v3.15.0 || echo "Skipping helm-secret"
26+
927

1028
echo "Set shell rc file:"
1129
echo 'echo export PATH="$HOME/go/bin:$PATH" >> $HOME/.zshrc'

0 commit comments

Comments
 (0)