chore(ci): add screenshots generation (#9582)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [ ] ⚖️ My code follows the style guidelines of this project
- [ ] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
This commit is contained in:
Stavros Kois 2023-06-13 10:56:52 +03:00 committed by GitHub
parent fa84fb773d
commit a2dbca0ed4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -75,6 +75,18 @@ patch_apps() {
sed -i "s|^icon:|icon_url:|g" catalog/${train}/${chartname}/item.yaml sed -i "s|^icon:|icon_url:|g" catalog/${train}/${chartname}/item.yaml
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
# Generate screenshots
screenshots=$(ls ${target}/screenshots)
if [[ -n $screenshots ]]; then
echo "screenshots:" >> catalog/${train}/${chartname}/item.yaml
for screenshot in $screenshots; do
echo " - https://truecharts.org/img/hotlink-ok/chart-screenshots/${chartname}/${screenshot}" >> catalog/${train}/${chartname}/item.yaml
done
else
echo "screenshots: []" >> catalog/${train}/${chartname}/item.yaml
fi
rm -rf ${target}/screenshots
# Copy changelog from website # Copy changelog from website
if [[ ! -f "website/docs/charts/${train}/${chartname}/CHANGELOG.md" ]]; then if [[ ! -f "website/docs/charts/${train}/${chartname}/CHANGELOG.md" ]]; then
touch "website/docs/charts/${train}/${chartname}/CHANGELOG.md" touch "website/docs/charts/${train}/${chartname}/CHANGELOG.md"

View File

@ -184,6 +184,7 @@ jobs:
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..."
yes | cp -rf charts/${train}/${chart}/docs/* website/docs/charts/${train}/${chart}/ 2>/dev/null || : yes | cp -rf charts/${train}/${chart}/docs/* website/docs/charts/${train}/${chart}/ 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 || :
yes | cp -rf charts/${train}/${chart}/screenshots/* website/static/img/hotlink-ok/chart-screenshots/${chart}/ 2>/dev/null || :
# Copy over kept documents # Copy over kept documents
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 || :