Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make sure installed chartsnap version matches desired #1064

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ kube-linter:

.PHONY: chartsnap
chartsnap:
@helm plugin list | grep chartsnap > /dev/null || \
helm plugin install https://github.com/jlandowner/helm-chartsnap --version $(CHARTSNAP_VERSION)
./scripts/install-chartsnap.sh

.PHONY: lint
lint: tools lint.charts.kong lint.shellcheck
Expand Down
15 changes: 15 additions & 0 deletions scripts/install-chartsnap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

CHARTSNAP_VERSION="0.3.1"

# Only install the plugin if it is not already installed or if the version is different.
if [[ $(helm plugin list | grep chartsnap | grep -Eo '[0-9]{1,}.[0-9]{1,}.[0-9]{1,}') == "${CHARTSNAP_VERSION}" ]]; then
echo "INFO: chartsnap plugin is already installed and up to date"
else
echo "INFO: Installing chartsnap plugin"
if [ "$(helm plugin list | grep -ic chartsnap)" -eq 1 ]; then
echo "INFO: Uninstalling existing chartsnap plugin - version mismatch"
helm plugin uninstall chartsnap
fi
helm plugin install https://github.com/jlandowner/helm-chartsnap --version "${CHARTSNAP_VERSION}"
fi
Loading