From daf10ca6192c78948dd37adfea38aa99b0f36246 Mon Sep 17 00:00:00 2001 From: Rohil Surana Date: Sat, 10 Apr 2021 22:47:15 +0530 Subject: [PATCH] fix: creation timestamp of old chart versions to be preserved --- src/entrypoint.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/entrypoint.sh b/src/entrypoint.sh index cd79751..7826ac2 100644 --- a/src/entrypoint.sh +++ b/src/entrypoint.sh @@ -150,13 +150,15 @@ upload() { charts=$(cd ${CHARTS_TMP_DIR} && ls *.tgz | xargs) mkdir -p ${TARGET_DIR} - mv -f ${CHARTS_TMP_DIR}/*.tgz ${TARGET_DIR} if [[ -f "${TARGET_DIR}/index.yaml" ]]; then echo "Found index, merging changes" - helm repo index ${TARGET_DIR} --url ${CHARTS_URL} --merge "${TARGET_DIR}/index.yaml" + helm repo index ${CHARTS_TMP_DIR} --url ${CHARTS_URL} --merge "${TARGET_DIR}/index.yaml" + mv -f ${CHARTS_TMP_DIR}/*.tgz ${TARGET_DIR} + mv -f ${CHARTS_TMP_DIR}/index.yaml ${TARGET_DIR}/index.yaml else echo "No index found, generating a new one" + mv -f ${CHARTS_TMP_DIR}/*.tgz ${TARGET_DIR} helm repo index ${TARGET_DIR} --url ${CHARTS_URL} fi