From c8df7aa4751918031badf81eadc35491eaa701f6 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Fri, 24 Apr 2020 14:29:09 +0530 Subject: [PATCH] create temp directory to push helm charts Instead of creating the tmp directory in ceph-csi create temp directory outside and use it to push helm charts Signed-off-by: Madhu Rajanna --- deploy.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/deploy.sh b/deploy.sh index c3f8e50a2..b4ba8c723 100755 --- a/deploy.sh +++ b/deploy.sh @@ -5,6 +5,7 @@ source "$(dirname "${0}")/scripts/build_step.inc.sh" push_helm_charts() { PACKAGE=$1 + CHARTDIR=$2 VERSION=${ENV_CSI_IMAGE_VERSION//v/} # Set version (without v prefix) # update information in Chart.yaml if the branch is not master @@ -23,13 +24,14 @@ push_helm_charts() { fi fi - mkdir -p tmp/csi-charts/docs/"$PACKAGE" - pushd tmp/csi-charts/docs/"$PACKAGE" >/dev/null + mkdir -p "$CHARTDIR/csi-charts/docs/$PACKAGE" + cp -R "./charts/ceph-csi-$PACKAGE" "$CHARTDIR/csi-charts/docs/$PACKAGE" + pushd "$CHARTDIR/csi-charts/docs/$PACKAGE" >/dev/null helm init --client-only - helm package ../../../../charts/ceph-csi-"$PACKAGE" + helm package "ceph-csi-$PACKAGE" popd >/dev/null - pushd tmp/csi-charts/docs >/dev/null + pushd "$CHARTDIR/csi-charts/docs" >/dev/null helm repo index . git add --all :/ && git commit -m "Update for helm charts $PACKAGE-$VERSION" git push https://"$GITHUB_TOKEN"@github.com/ceph/csi-charts @@ -93,8 +95,9 @@ if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then build_push_images - mkdir -p tmp - pushd tmp >/dev/null + CSI_CHARTS_DIR=$(mktemp -d) + + pushd "$CSI_CHARTS_DIR" >/dev/null curl -L https://git.io/get_helm.sh | bash @@ -105,8 +108,10 @@ if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then popd >/dev/null build_step "pushing RBD helm charts" - push_helm_charts rbd + push_helm_charts rbd "$CSI_CHARTS_DIR" build_step "pushing CephFS helm charts" - push_helm_charts cephfs + push_helm_charts cephfs "$CSI_CHARTS_DIR" build_step_log "finished deployment!" + + [ -n "${CSI_CHARTS_DIR}" ] && rm -rf "${CSI_CHARTS_DIR}" fi