make sure there a CHANGELOG.md to copy... (#5029)
This commit is contained in:
@@ -3,7 +3,7 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
include_questions(){
|
include_questions() {
|
||||||
local chart="$1"
|
local chart="$1"
|
||||||
local chartname="$2"
|
local chartname="$2"
|
||||||
local train="$3"
|
local train="$3"
|
||||||
@@ -17,7 +17,7 @@ include_questions(){
|
|||||||
|
|
||||||
echo "Including standardised questions.yaml includes for: ${chartname}"
|
echo "Including standardised questions.yaml includes for: ${chartname}"
|
||||||
sed -i -E 's:^.*# Include\{(.*)\}.*$:cat templates/questions/**/\1.yaml:e' ${target}
|
sed -i -E 's:^.*# Include\{(.*)\}.*$:cat templates/questions/**/\1.yaml:e' ${target}
|
||||||
}
|
}
|
||||||
export -f include_questions
|
export -f include_questions
|
||||||
|
|
||||||
clean_catalog() {
|
clean_catalog() {
|
||||||
@@ -29,12 +29,12 @@ clean_catalog() {
|
|||||||
local majorversions=$( (find . -mindepth 1 -maxdepth 1 -type d \( ! -iname ".*" \) | sed 's|^\./||g') | sort -Vr | cut -c1 | uniq)
|
local majorversions=$( (find . -mindepth 1 -maxdepth 1 -type d \( ! -iname ".*" \) | sed 's|^\./||g') | sort -Vr | cut -c1 | uniq)
|
||||||
echo "Removing old versions for: ${chartname}"
|
echo "Removing old versions for: ${chartname}"
|
||||||
for majorversion in ${majorversions}; do
|
for majorversion in ${majorversions}; do
|
||||||
local maxofmajor=$( (find . -mindepth 1 -maxdepth 1 -type d \( -iname "${majorversion}.*" \) | sed 's|^\./||g') | sort -Vr | head -n1 )
|
local maxofmajor=$( (find . -mindepth 1 -maxdepth 1 -type d \( -iname "${majorversion}.*" \) | sed 's|^\./||g') | sort -Vr | head -n1 )
|
||||||
local rmversions=$( (find . -mindepth 1 -maxdepth 1 -type d \( -iname "${majorversion}.*" \) \( ! -iname "${maxofmajor}" \) | sed 's|^\./||g') | sort -Vr )
|
local rmversions=$( (find . -mindepth 1 -maxdepth 1 -type d \( -iname "${majorversion}.*" \) \( ! -iname "${maxofmajor}" \) | sed 's|^\./||g') | sort -Vr )
|
||||||
rm -Rf ${rmversions}
|
rm -Rf ${rmversions}
|
||||||
done
|
done
|
||||||
cd -
|
cd -
|
||||||
}
|
}
|
||||||
export -f clean_catalog
|
export -f clean_catalog
|
||||||
|
|
||||||
clean_apps() {
|
clean_apps() {
|
||||||
@@ -76,6 +76,9 @@ patch_apps() {
|
|||||||
echo "categories:" >> catalog/${train}/${chartname}/item.yaml
|
echo "categories:" >> catalog/${train}/${chartname}/item.yaml
|
||||||
cat ${target}/Chart.yaml | yq '.annotations."truecharts.org/catagories"' -r >> catalog/${train}/${chartname}/item.yaml
|
cat ${target}/Chart.yaml | yq '.annotations."truecharts.org/catagories"' -r >> catalog/${train}/${chartname}/item.yaml
|
||||||
# Copy changelog from website
|
# 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 || :
|
cp -rf "website/docs/charts/${train}/${chart}/CHANGELOG.md" "${target}/CHANGELOG.md" 2>/dev/null || :
|
||||||
sed -i '1d' "${target}/CHANGELOG.md"
|
sed -i '1d' "${target}/CHANGELOG.md"
|
||||||
sed -i '1s/^/*for the complete changelog, please refer to the website*\n\n/' "${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
|
export -f copy_apps
|
||||||
|
|
||||||
|
|
||||||
if [[ -d "charts/${1}" ]]; then
|
if [[ -d "charts/${1}" ]]; then
|
||||||
echo "Start processing charts/${1} ..."
|
echo "Start processing charts/${1} ..."
|
||||||
chartversion=$(cat charts/${1}/Chart.yaml | grep "^version: " | awk -F" " '{ print $2 }')
|
chartversion=$(cat charts/${1}/Chart.yaml | grep "^version: " | awk -F" " '{ print $2 }')
|
||||||
@@ -113,13 +115,13 @@ if [[ -d "charts/${1}" ]]; then
|
|||||||
train=$(basename $(dirname "charts/${1}"))
|
train=$(basename $(dirname "charts/${1}"))
|
||||||
SCALESUPPORT=$(cat charts/${1}/Chart.yaml | yq '.annotations."truecharts.org/SCALE-support"' -r)
|
SCALESUPPORT=$(cat charts/${1}/Chart.yaml | yq '.annotations."truecharts.org/SCALE-support"' -r)
|
||||||
if [[ "${SCALESUPPORT}" == "true" ]]; then
|
if [[ "${SCALESUPPORT}" == "true" ]]; then
|
||||||
clean_apps "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
clean_apps "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
||||||
copy_apps "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
copy_apps "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
||||||
patch_apps "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
patch_apps "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
||||||
include_questions "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
include_questions "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
||||||
clean_catalog "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
clean_catalog "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
||||||
else
|
else
|
||||||
echo "Skipping chart charts/${1}, no correct SCALE compatibility layer detected"
|
echo "Skipping chart charts/${1}, no correct SCALE compatibility layer detected"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Chart 'charts/${1}' no longer exists in repo. Skipping it..."
|
echo "Chart 'charts/${1}' no longer exists in repo. Skipping it..."
|
||||||
|
|||||||
Reference in New Issue
Block a user