From 5c6c5a76c52288c9a910c98c9f1b31baf0cb0cee Mon Sep 17 00:00:00 2001 From: ElderMatt <18527012+ElderMatt@users.noreply.github.com> Date: Tue, 4 Feb 2025 17:43:58 +0100 Subject: [PATCH] fix: check for helm secrets version and update it --- bin/install-deps.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/bin/install-deps.sh b/bin/install-deps.sh index dbad847559..ec456be9e1 100755 --- a/bin/install-deps.sh +++ b/bin/install-deps.sh @@ -4,8 +4,26 @@ go install github.com/noqcks/gucci@latest go install github.com/plexsystems/konstraint@latest npm install -g json-dereference-cli +# Desired version +helm_secrets_target_version="4.6.2" + +# Get the installed version of helm-secrets +helm_secrets_installed_version=$(helm plugin list | awk '/secrets/ {print $2}') + +# Compare versions and update if necessary +if [ -z "$helm_secrets_installed_version" ]; then + echo "helm-secrets is not installed. Installing version $helm_secrets_target_version..." + helm plugin install https://github.com/jkroepke/helm-secrets --version "$helm_secrets_target_version" +elif [ "$(printf '%s\n' "$helm_secrets_installed_version" "$helm_secrets_target_version" | sort -V | head -n1)" != "$helm_secrets_target_version" ]; then + echo "Updating helm-secrets from version $helm_secrets_installed_version to $helm_secrets_target_version..." + helm plugin uninstall secrets + helm plugin install https://github.com/jkroepke/helm-secrets --version "$helm_secrets_target_version" +else + echo "helm-secrets is up-to-date (version $helm_secrets_installed_version)." +fi + helm plugin install https://github.com/databus23/helm-diff.git || echo "Skipping helm-diff" -helm plugin install https://github.com/jkroepke/helm-secrets.git --version v3.15.0 || echo "Skipping helm-secret" + echo "Set shell rc file:" echo 'echo export PATH="$HOME/go/bin:$PATH" >> $HOME/.zshrc'