2022-01-04 00:10:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd $(dirname $0)
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
if [[ -z ${CHART} ]] || [[ -z ${VERSION} ]]; then
|
|
|
|
echo "Usage: CHART=<chart> VERSION=<version> make remove"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -d charts/${CHART}/${VERSION} ]] && [[ -f assets/${CHART}/${CHART}-${VERSION}.tgz ]]; then
|
|
|
|
rm -rf charts/${CHART}/${VERSION}
|
|
|
|
rm -rf assets/${CHART}/${CHART}-${VERSION}.tgz
|
|
|
|
else
|
|
|
|
[[ -d charts/${CHART}/${VERSION} ]] || echo "Could not find charts/${CHART}/${VERSION}"
|
|
|
|
[[ -f assets/${CHART}/${CHART}-${VERSION}.tgz ]] || echo "Could not find assets/${CHART}/${CHART}-${VERSION}.tgz"
|
|
|
|
echo "No action was taken."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Prune empty directories
|
|
|
|
set +e
|
2024-05-24 19:44:54 +00:00
|
|
|
rmdir charts/${CHART} >/dev/null 2>&1
|
|
|
|
rmdir charts >/dev/null 2>&1
|
|
|
|
rmdir assets/${CHART} >/dev/null 2>&1
|
|
|
|
rmdir assets >/dev/null 2>&1
|
2022-01-04 00:10:36 +00:00
|
|
|
set -e
|
|
|
|
|
2024-05-24 19:44:54 +00:00
|
|
|
touch release.yaml
|
|
|
|
yq e -i ".${CHART} = ((.${CHART} + [\"${VERSION}\"]) | unique)" release.yaml
|
|
|
|
|
2022-01-04 00:10:36 +00:00
|
|
|
make index
|