make sure there a CHANGELOG.md to copy... (#5029)

This commit is contained in:
Stavros Kois
2022-11-30 22:52:06 +01:00
committed by GitHub
parent 3b1c1db3fe
commit 515079b098
+6 -4
View File
@@ -3,7 +3,7 @@ set -o errexit
set -o nounset
set -o pipefail
include_questions(){
include_questions() {
local chart="$1"
local chartname="$2"
local train="$3"
@@ -17,7 +17,7 @@ include_questions(){
echo "Including standardised questions.yaml includes for: ${chartname}"
sed -i -E 's:^.*# Include\{(.*)\}.*$:cat templates/questions/**/\1.yaml:e' ${target}
}
}
export -f include_questions
clean_catalog() {
@@ -34,7 +34,7 @@ clean_catalog() {
rm -Rf ${rmversions}
done
cd -
}
}
export -f clean_catalog
clean_apps() {
@@ -76,6 +76,9 @@ patch_apps() {
echo "categories:" >> catalog/${train}/${chartname}/item.yaml
cat ${target}/Chart.yaml | yq '.annotations."truecharts.org/catagories"' -r >> catalog/${train}/${chartname}/item.yaml
# Copy changelog from website
if [[ ! -f "website/docs/charts/${train}/${chart}/CHANGELOG.md" ]]; then
touch "website/docs/charts/${train}/${chart}/CHANGELOG.md"
fi
cp -rf "website/docs/charts/${train}/${chart}/CHANGELOG.md" "${target}/CHANGELOG.md" 2>/dev/null || :
sed -i '1d' "${target}/CHANGELOG.md"
sed -i '1s/^/*for the complete changelog, please refer to the website*\n\n/' "${target}/CHANGELOG.md"
@@ -105,7 +108,6 @@ copy_apps() {
}
export -f copy_apps
if [[ -d "charts/${1}" ]]; then
echo "Start processing charts/${1} ..."
chartversion=$(cat charts/${1}/Chart.yaml | grep "^version: " | awk -F" " '{ print $2 }')