diff --git a/README.md b/README.md index 9c31f79..a09589e 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,11 @@ More info on [sops page](https://github.com/mozilla/sops#showing-diffs-in-cleart #### Using Helm plugin manager (> 2.3.x) +If you want to install it without root access it's necessary to set the environment variable `NOROOT` to `true`. +``` +export NOROOT=true; heml plugin install https://github.com/futuresimple/helm-secrets +``` + As already described above, ``` helm plugin install https://github.com/futuresimple/helm-secrets diff --git a/install-binary.sh b/install-binary.sh index 2d38494..be67b59 100755 --- a/install-binary.sh +++ b/install-binary.sh @@ -7,6 +7,7 @@ SOPS_DEB_URL="https://github.com/mozilla/sops/releases/download/${SOPS_VERSION}/ SOPS_DEB_SHA="9d9f319882ba05e7050be91bdfc396167ac9b00e2e6f634a647d55ac97915bb6" SOPS_LINUX_URL="https://github.com/mozilla/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION}.linux" SOPS_LINUX_SHA="e185d2752defdcb18c054f67682a6684c72d6a6bf2341f6bef1dd7d33a110459" +NOROOT="${NOROOT:=false}" RED='\033[0;31m' GREEN='\033[0;32m' @@ -49,7 +50,7 @@ else brew install sops elif [ "$(uname)" == "Linux" ]; then - if which dpkg; + if [ "$(which dpkg)" ] && [ "${NOROOT}" == false ]; then curl -sL "${SOPS_DEB_URL}" > /tmp/sops if [ "$(get_sha_256 /tmp/sops)" == "${SOPS_DEB_SHA}" ]; @@ -63,7 +64,17 @@ else if [ "$(get_sha_256 /tmp/sops)" == "${SOPS_LINUX_SHA}" ]; then chmod +x /tmp/sops - mv /tmp/sops /usr/local/bin/ + + if [ "${NOROOT}" == true ]; + then + if [ ! -d "$HOME/bin" ]; + then + mkdir $HOME/bin + fi + mv /tmp/sops $HOME/bin + else + mv /tmp/sops /usr/local/bin/ + fi else echo -e "${RED}Wrong SHA256${NOC}" fi diff --git a/plugin.yaml b/plugin.yaml index 0f043ae..ca3d7ef 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,5 +1,5 @@ name: "secrets" -version: "2.0.2" +version: "2.0.3" usage: "Secrets encryption in Helm for Git storing" description: |- This plugin provides secrets values encryption for Helm charts secure storing