make sure changelog exists earlier

This commit is contained in:
Stavros Kois 2022-12-18 22:39:57 +02:00 committed by GitHub
parent 26a07b59c0
commit 611e690a4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -93,6 +93,13 @@ jobs:
chart=${chart_parts[1]} chart=${chart_parts[1]}
echo "copying docs to website for ${chart}" echo "copying docs to website for ${chart}"
mkdir -p tmp/website/docs/charts/${train}/${chart}/ || echo "chart path already exists, continuing..." mkdir -p tmp/website/docs/charts/${train}/${chart}/ || echo "chart path already exists, continuing..."
if [[ -f "website/docs/charts/${train}/${chart}/CHANGELOG.md" ]]; then
echo "changelog found..."
true
else
echo "changelog not found, starting with empty changelog..."
touch "website/docs/charts/${train}/${chart}/CHANGELOG.md"
fi
mv -f website/docs/charts/${train}/${chart}/CHANGELOG.md tmp/website/docs/charts/${train}/${chart}/CHANGELOG.md || : mv -f website/docs/charts/${train}/${chart}/CHANGELOG.md tmp/website/docs/charts/${train}/${chart}/CHANGELOG.md || :
rm -rf website/docs/charts/*/${chart} || : rm -rf website/docs/charts/*/${chart} || :
mkdir -p website/docs/charts/${train}/${chart} || echo "chart path already exists, continuing..." mkdir -p website/docs/charts/${train}/${chart} || echo "chart path already exists, continuing..."
@ -125,13 +132,6 @@ jobs:
mv -f tmp/website/docs/charts/${train}/${chart}/CHANGELOG.md website/docs/charts/${train}/${chart}/CHANGELOG.md 2>/dev/null || : mv -f tmp/website/docs/charts/${train}/${chart}/CHANGELOG.md website/docs/charts/${train}/${chart}/CHANGELOG.md 2>/dev/null || :
yes | cp -rf charts/${train}/${chart}/icon.png website/static/img/hotlink-ok/chart-icons/${chart}.png 2>/dev/null || : yes | cp -rf charts/${train}/${chart}/icon.png website/static/img/hotlink-ok/chart-icons/${chart}.png 2>/dev/null || :
# Append SCALE changelog to actual changelog # Append SCALE changelog to actual changelog
if [[ -f "website/docs/charts/${train}/${chart}/CHANGELOG.md" ]]; then
echo "changelog found..."
true
else
echo "changelog not found, starting with empty changelog..."
touch "website/docs/charts/${train}/${chart}/CHANGELOG.md"
fi
sed -i '1d' "website/docs/charts/${train}/${chart}/CHANGELOG.md" || echo "failed to sed 1d changelog..." sed -i '1d' "website/docs/charts/${train}/${chart}/CHANGELOG.md" || echo "failed to sed 1d changelog..."
cat "charts/${train}/${chart}/app-changelog.md" | cat - "website/docs/charts/${train}/${chart}/CHANGELOG.md" > temp && mv temp "website/docs/charts/${train}/${chart}/CHANGELOG.md" cat "charts/${train}/${chart}/app-changelog.md" | cat - "website/docs/charts/${train}/${chart}/CHANGELOG.md" > temp && mv temp "website/docs/charts/${train}/${chart}/CHANGELOG.md"
sed -i '1s/^/# Changelog\n\n/' "website/docs/charts/${train}/${chart}/CHANGELOG.md" || echo "failed to add changelog header..." sed -i '1s/^/# Changelog\n\n/' "website/docs/charts/${train}/${chart}/CHANGELOG.md" || echo "failed to add changelog header..."