[ACS-12260]: Automated alfresco pdf rendered updates (#1319)

This commit is contained in:
Vivek Kumar
2026-07-31 18:00:45 +05:30
committed by GitHub
parent 4430f337a6
commit 28ad62693d
3 changed files with 114 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -euo pipefail
TAGS=$(gh api --paginate repos/Alfresco/alfresco-pdf-renderer/tags --jq '.[].name')
LATEST=$(printf '%s\n' "${TAGS}" \
| grep -E '^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+$' \
| sort -V \
| tail -n1 || true)
if [ -z "${LATEST}" ]; then
echo "::error::Could not determine the latest alfresco-pdf-renderer release tag"
exit 1
fi
CURRENT_PDF=$(grep -oP '^ARG PDF_RENDERER_VERSION=\K.*' engines/pdfrenderer/Dockerfile)
CURRENT_AIO=$(grep -oP '^ARG PDF_RENDERER_VERSION=\K.*' engines/aio/Dockerfile)
if [ "${CURRENT_PDF}" != "${CURRENT_AIO}" ]; then
echo "::error::PDF_RENDERER_VERSION differs between Dockerfiles (pdfrenderer=${CURRENT_PDF}, aio=${CURRENT_AIO}); please reconcile them first"
exit 1
fi
CURRENT="${CURRENT_PDF}"
echo "Latest alfresco-pdf-renderer release: ${LATEST}"
echo "Current version in Dockerfiles: ${CURRENT}"
echo "latest=${LATEST}" >> "$GITHUB_OUTPUT"
if [ "${LATEST}" = "${CURRENT}" ]; then
echo "Already up to date; nothing to do."
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Rewrites the pinned ARG PDF_RENDERER_VERSION in both Dockerfiles.
# Requires: LATEST.
set -euo pipefail
sed -i "s/^ARG PDF_RENDERER_VERSION=.*/ARG PDF_RENDERER_VERSION=${LATEST}/" \
engines/pdfrenderer/Dockerfile \
engines/aio/Dockerfile
git --no-pager diff engines/pdfrenderer/Dockerfile engines/aio/Dockerfile