From 1be7dcd3bd175f5bc793d022e0f27d22960be2de Mon Sep 17 00:00:00 2001 From: Robert Church Date: Thu, 18 Apr 2019 15:21:44 -0400 Subject: [PATCH] Add support for multiple helm repositories in helm-upload Update the helm-upload script to require specifying a specific helm repository to use with it's operations. Change-Id: I4b1a3615a6bd5d0bdd834a1cdf27c05d5a1057a0 Story: 2005424 Task: 30645 Signed-off-by: Robert Church --- kubernetes/helm/centos/build_srpm.data | 2 +- kubernetes/helm/centos/files/helm-upload | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/kubernetes/helm/centos/build_srpm.data b/kubernetes/helm/centos/build_srpm.data index 19be238cc..f5632fa03 100644 --- a/kubernetes/helm/centos/build_srpm.data +++ b/kubernetes/helm/centos/build_srpm.data @@ -3,4 +3,4 @@ TAR_NAME=helm TAR="$TAR_NAME-v$VERSION-linux-amd64.tar.gz" COPY_LIST="${CGCS_BASE}/downloads/$TAR $FILES_BASE/*" -TIS_PATCH_VER=1 +TIS_PATCH_VER=2 diff --git a/kubernetes/helm/centos/files/helm-upload b/kubernetes/helm/centos/files/helm-upload index 824b7c93d..4dbacc088 100644 --- a/kubernetes/helm/centos/files/helm-upload +++ b/kubernetes/helm/centos/files/helm-upload @@ -22,7 +22,22 @@ fi RETVAL=0 REINDEX=0 -REPO_DIR='/www/pages/helm_charts' +REPO_BASE='/www/pages/helm_charts' + +# First argument is always the repo where the charts need to be placed +if [ $# -lt 2 ]; then + echo "Usage: helm-upload .. " + exit 1 +fi + +# Make sure the repo directory exists +REPO_DIR="${REPO_BASE}/$1" +if [ ! -e $REPO_DIR ]; then + echo "$REPO_DIR doesn't exist." + exit 1 +fi + +shift 1 for FILE in "$@"; do if [ -r $FILE ]; then