Skip to content

Add helm plugin.yaml #290

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ dist
.idea/
*.iml
.vscode/
vendor/
vendor/
bin/
releases/
53 changes: 53 additions & 0 deletions install_plugin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh -e

# Copied w/ love from the excellent hypnoglow/helm-s3

version="$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)"
echo "Downloading and installing helm-docs v${version} ..."

url=""

arch=""
case $(uname -m) in
x86_64)
arch="x86_64"
;;
armv6*)
arch="arm6"
;;
# match every arm processor version like armv7h, armv7l and so on.
armv7*)
arch="arm7"
;;
aarch64 | arm64)
arch="arm64"
;;
*)
echo "Failed to detect target architecture"
exit 1
;;
esac


if [ "$(uname)" = "Darwin" ]; then
url="https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_${version}_Darwin_${arch}.tar.gz"
elif [ "$(uname)" = "Linux" ] ; then
url="https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_${version}_Linux_${arch}.tar.gz"
else
url="https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_${version}_Windows_${arch}.tar.gz"
fi

echo $url

mkdir -p "bin"
mkdir -p "releases/v${version}"

# Download with curl if possible.
if [ -x "$(which curl 2>/dev/null)" ]; then
curl -sSL "${url}" -o "releases/v${version}.tar.gz"
else
wget -q "${url}" -O "releases/v${version}.tar.gz"
fi
tar xzf "releases/v${version}.tar.gz" -C "releases/v${version}"
mv "releases/v${version}/helm-docs" "bin/helm-chart-docs" || \
mv "releases/v${version}/helm-docs.exe" "bin/helm-chart-docs"
9 changes: 9 additions & 0 deletions plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: "chart-docs"
version: "1.14.2"
usage: "Please see https://github.com/norwoodj/helm-docs for usage"
description: "A tool for automatically generating markdown documentation for helm charts"
useTunnel: false
command: "$HELM_PLUGIN_DIR/bin/helm-chart-docs"
hooks:
install: "cd $HELM_PLUGIN_DIR; ./install_plugin.sh"
update: "cd $HELM_PLUGIN_DIR; ./install_plugin.sh"