diff options
author | 2021-03-16 16:00:26 +0100 | |
---|---|---|
committer | 2021-03-17 12:07:37 +0100 | |
commit | e0437a4237c99a16955d5ec56ff5fe9996c76b57 (patch) | |
tree | e069f513aae60fcc4636dd80978ce477c9ed47a7 /scripts | |
parent | 919ae37310243f676eafee0ebf01c9d64ee5b925 (diff) |
Add helm validator sources
Issue-ID: SDC-3185
Signed-off-by: Remigiusz Janeczek <remigiusz.janeczek@nokia.com>
Change-Id: I32dea3b4294a90c4dfc75864fb4200f044e7a0b6
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/collect_helm_versions_from_web.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/scripts/collect_helm_versions_from_web.sh b/scripts/collect_helm_versions_from_web.sh new file mode 100755 index 0000000..6155149 --- /dev/null +++ b/scripts/collect_helm_versions_from_web.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +set -e + +HELM_TMP_DIR=helm_tmp +HELM_VERSIONS_DIR=helm_versions +IS_LOCAL=false +if [ "$1" == "local" ]; then + IS_LOCAL=true +fi + +readarray -d , -t SUPPORTED_VERSION_ARRAY <<<"$HELM_SUPPORTED_VERSIONS" + +mkdir -p $HELM_VERSIONS_DIR +mkdir -p $HELM_TMP_DIR + +getHelm() { + VERSION=$1 + echo "Attempt to collect HELM ${VERSION}" + + if [ -a "$HELM_VERSIONS_DIR/helm-v${VERSION}" ]; then + echo "HELM ${VERSION} already exists" + else + mkdir -p $HELM_TMP_DIR/v${VERSION} + echo "Downloading..." + wget -q https://get.helm.sh/helm-v${VERSION}-linux-amd64.tar.gz -O $HELM_TMP_DIR/helm-v${VERSION}.tar.gz + echo "Archive Extracting..." + tar -zxvf $HELM_TMP_DIR/helm-v${VERSION}.tar.gz -C $HELM_TMP_DIR/v${VERSION} linux-amd64/helm + mv $HELM_TMP_DIR/v${VERSION}/linux-amd64/helm $HELM_VERSIONS_DIR/helm-v${VERSION} + fi + + echo "DONE" +} + +for i in "${SUPPORTED_VERSION_ARRAY[@]}"; do + getHelm $i +done + +if [ $IS_LOCAL == false ]; then + mv $HELM_VERSIONS_DIR/* /usr/local/bin/ + rm -r $HELM_VERSIONS_DIR + rm -r $HELM_TMP_DIR +fi |