aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-minimal-onap/tools/get_helm.sh
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2019-12-05 13:45:45 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2019-12-18 07:31:11 +0000
commitf1176daf78a691d31a13b698d9401a20ce51c5b4 (patch)
treefbf98529b39262b4fd8ad3fed4f31471b86076b0 /bootstrap/vagrant-minimal-onap/tools/get_helm.sh
parentdf0edea0c75b1bd99f26779be7d7b60d5fcb3481 (diff)
Add helm provisioners (downloading and setting up with OOM plugins)
Issue-ID: ONAPARC-537 Change-Id: I3b3d731ae016c78b3e00841157c69aded14635e2 Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
Diffstat (limited to 'bootstrap/vagrant-minimal-onap/tools/get_helm.sh')
-rw-r--r--bootstrap/vagrant-minimal-onap/tools/get_helm.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/bootstrap/vagrant-minimal-onap/tools/get_helm.sh b/bootstrap/vagrant-minimal-onap/tools/get_helm.sh
new file mode 100644
index 000000000..ad678e984
--- /dev/null
+++ b/bootstrap/vagrant-minimal-onap/tools/get_helm.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+#
+# @file test/security/k8s/tools/dublin/get_helm.sh
+# @author Pawel Wieczorek <p.wieczorek2@samsung.com>
+# @brief Utility for obtaining helm tool
+#
+
+# Dependencies:
+# wget
+# tar
+# coreutils
+#
+# Privileges:
+# Script expects to be run with administrative privileges for accessing /usr/local/bin
+#
+# Usage:
+# # ./get_helm.sh [VERSION [ARCH [SYSTEM]]]
+#
+
+# Constants
+BINARY='helm'
+INSTALL_DIR='/usr/local/bin/'
+
+DEFAULT_VERSION='v2.14.2'
+DEFAULT_ARCH='amd64'
+DEFAULT_SYSTEM='linux'
+
+# Variables
+VERSION="${1:-$DEFAULT_VERSION}"
+ARCH="${2:-$DEFAULT_ARCH}"
+SYSTEM="${3:-$DEFAULT_SYSTEM}"
+
+URL="https://storage.googleapis.com/kubernetes-helm/${BINARY}-${VERSION}-${SYSTEM}-${ARCH}.tar.gz"
+ARCHIVE="${URL##*/}"
+DIR="${SYSTEM}-${ARCH}"
+
+
+# Prerequistes
+wget "$URL"
+tar xf "$ARCHIVE"
+
+# Installation
+mv "${DIR}/${BINARY}" "$INSTALL_DIR"
+
+# Cleanup
+rm "$ARCHIVE"
+rm -r "$DIR"