From c498e40568ad347c2fe739325376872c9d475810 Mon Sep 17 00:00:00 2001 From: Davi Koscianski Vidal Date: Wed, 15 Jan 2025 10:40:31 +0100 Subject: [PATCH] SGB-270 Fixes upload_chart script --- .cirrus/upload_chart.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.cirrus/upload_chart.sh b/.cirrus/upload_chart.sh index e98d5174c..c006ec073 100755 --- a/.cirrus/upload_chart.sh +++ b/.cirrus/upload_chart.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -euo pipefail +set -xeuo pipefail : "${ARTIFACTORY_URL:?}" : "${ARTIFACTORY_ACCESS_TOKEN:?}" @@ -20,9 +20,11 @@ fi find_charts=$(find "${CIRRUS_WORKING_DIR}" -maxdepth 1 -name "${NAME_GLOB}" -type f -exec basename "{}" ";" || exit 1) CHART_TO_UPLOAD=() -while IFS= read -r chart; do - CHART_TO_UPLOAD+=("${chart}") -done <<< "${find_charts}" +if [[ -n "${find_charts}" ]]; then + while IFS= read -r chart; do + CHART_TO_UPLOAD+=("${chart}") + done <<< "${find_charts}" +fi if [[ ${#CHART_TO_UPLOAD[@]} -eq 0 ]]; then echo "No charts found to upload."