Skip to content

Commit f546639

Browse files
authored
Merge branch 'master' into kepubify_update
2 parents af216ea + a518a2b commit f546639

9 files changed

+488
-428
lines changed

.github/workflows/external_trigger.yml

+28-9
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,35 @@ jobs:
4343
token=$(curl -sX GET \
4444
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fcalibre-web%3Apull" \
4545
| jq -r '.token')
46-
multidigest=$(curl -s \
47-
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
48-
--header "Authorization: Bearer ${token}" \
49-
"https://ghcr.io/v2/${image}/manifests/${tag}" \
50-
| jq -r 'first(.manifests[].digest)')
51-
digest=$(curl -s \
46+
multidigest=$(curl -s \
47+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
48+
--header "Accept: application/vnd.oci.image.index.v1+json" \
49+
--header "Authorization: Bearer ${token}" \
50+
"https://ghcr.io/v2/${image}/manifests/${tag}")
51+
if jq -e '.layers // empty' <<< "${multidigest}" >/dev/null 2>&1; then
52+
# If there's a layer element it's a single-arch manifest so just get that digest
53+
digest=$(jq -r '.config.digest' <<< "${multidigest}")
54+
else
55+
# Otherwise it's multi-arch or has manifest annotations
56+
if jq -e '.manifests[]?.annotations // empty' <<< "${multidigest}" >/dev/null 2>&1; then
57+
# Check for manifest annotations and delete if found
58+
multidigest=$(jq 'del(.manifests[] | select(.annotations))' <<< "${multidigest}")
59+
fi
60+
if [[ $(jq '.manifests | length' <<< "${multidigest}") -gt 1 ]]; then
61+
# If there's still more than one digest, it's multi-arch
62+
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
63+
else
64+
# Otherwise it's single arch
65+
multidigest=$(jq -r ".manifests[].digest?" <<< "${multidigest}")
66+
fi
67+
if digest=$(curl -s \
5268
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
69+
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
5370
--header "Authorization: Bearer ${token}" \
54-
"https://ghcr.io/v2/${image}/manifests/${multidigest}" \
55-
| jq -r '.config.digest')
71+
"https://ghcr.io/v2/${image}/manifests/${multidigest}"); then
72+
digest=$(jq -r '.config.digest' <<< "${digest}");
73+
fi
74+
fi
5675
image_info=$(curl -sL \
5776
--header "Authorization: Bearer ${token}" \
5877
"https://ghcr.io/v2/${image}/blobs/${digest}")
@@ -90,7 +109,7 @@ jobs:
90109
else
91110
printf "\n## Trigger new build\n\n" >> $GITHUB_STEP_SUMMARY
92111
echo "New version \`${EXT_RELEASE}\` found; old version was \`${IMAGE_VERSION}\`. Triggering new build" >> $GITHUB_STEP_SUMMARY
93-
if "${artifacts_found}" == "true" ]]; then
112+
if [[ "${artifacts_found}" == "true" ]]; then
94113
echo "All artifacts seem to be uploaded." >> $GITHUB_STEP_SUMMARY
95114
fi
96115
response=$(curl -iX POST \

.github/workflows/package_trigger_scheduler.yml

+22-5
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,26 @@ jobs:
2727
fi
2828
printf "\n## Evaluating \`%s\`\n\n" ${br} >> $GITHUB_STEP_SUMMARY
2929
JENKINS_VARS=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/jenkins-vars.yml)
30-
if [[ "${br}" == $(yq -r '.ls_branch' <<< "${JENKINS_VARS}") ]]; then
30+
if ! curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/Jenkinsfile >/dev/null 2>&1; then
31+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
32+
echo "> No Jenkinsfile found. Branch is either deprecated or is an early dev branch." >> $GITHUB_STEP_SUMMARY
33+
skipped_branches="${skipped_branches}${br} "
34+
elif [[ "${br}" == $(yq -r '.ls_branch' <<< "${JENKINS_VARS}") ]]; then
3135
echo "Branch appears to be live; checking workflow." >> $GITHUB_STEP_SUMMARY
32-
if [[ $(yq -r '.skip_package_check' <<< "${JENKINS_VARS}") == "true" ]]; then
36+
README_VARS=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-calibre-web/${br}/readme-vars.yml)
37+
if [[ $(yq -r '.project_deprecation_status' <<< "${README_VARS}") == "true" ]]; then
38+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
39+
echo "> Branch appears to be deprecated; skipping trigger." >> $GITHUB_STEP_SUMMARY
40+
skipped_branches="${skipped_branches}${br} "
41+
elif [[ $(yq -r '.skip_package_check' <<< "${JENKINS_VARS}") == "true" ]]; then
3342
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3443
echo "> Skipping branch ${br} due to \`skip_package_check\` being set in \`jenkins-vars.yml\`." >> $GITHUB_STEP_SUMMARY
3544
skipped_branches="${skipped_branches}${br} "
3645
elif grep -q "^calibre-web_${br}" <<< "${SKIP_PACKAGE_TRIGGER}"; then
3746
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3847
echo "> Github organizational variable \`SKIP_PACKAGE_TRIGGER\` contains \`calibre-web_${br}\`; skipping trigger." >> $GITHUB_STEP_SUMMARY
3948
skipped_branches="${skipped_branches}${br} "
40-
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/${br}/lastBuild/api/json | jq -r '.building') == "true" ]; then
49+
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/${br}/lastBuild/api/json | jq -r '.building' 2>/dev/null) == "true" ]; then
4150
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
4251
echo "> There already seems to be an active build on Jenkins; skipping package trigger for ${br}" >> $GITHUB_STEP_SUMMARY
4352
skipped_branches="${skipped_branches}${br} "
@@ -49,18 +58,26 @@ jobs:
4958
response=$(curl -iX POST \
5059
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-calibre-web/job/${br}/buildWithParameters?PACKAGE_CHECK=true \
5160
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
61+
if [[ -z "${response}" ]]; then
62+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
63+
echo "> Jenkins build could not be triggered. Skipping branch."
64+
continue
65+
fi
5266
echo "Jenkins [job queue url](${response%$'\r'})" >> $GITHUB_STEP_SUMMARY
5367
echo "Sleeping 10 seconds until job starts" >> $GITHUB_STEP_SUMMARY
5468
sleep 10
5569
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
5670
buildurl="${buildurl%$'\r'}"
5771
echo "Jenkins job [build url](${buildurl})" >> $GITHUB_STEP_SUMMARY
5872
echo "Attempting to change the Jenkins job description" >> $GITHUB_STEP_SUMMARY
59-
curl -iX POST \
73+
if ! curl -ifX POST \
6074
"${buildurl}submitDescription" \
6175
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
6276
--data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
63-
--data-urlencode "Submit=Submit"
77+
--data-urlencode "Submit=Submit"; then
78+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
79+
echo "> Unable to change the Jenkins job description."
80+
fi
6481
sleep 20
6582
fi
6683
else

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FROM ghcr.io/linuxserver/unrar:latest AS unrar
44

5-
FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy
5+
FROM ghcr.io/linuxserver/baseimage-ubuntu:noble
66

77
# set version label
88
ARG BUILD_DATE
@@ -23,8 +23,8 @@ RUN \
2323
apt-get install -y --no-install-recommends \
2424
imagemagick \
2525
ghostscript \
26-
libldap-2.5-0 \
27-
libmagic1 \
26+
libldap2 \
27+
libmagic1t64 \
2828
libsasl2-2 \
2929
libxi6 \
3030
libxslt1.1 \

Dockerfile.aarch64

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FROM ghcr.io/linuxserver/unrar:arm64v8-latest AS unrar
44

5-
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy
5+
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-noble
66

77
# set version label
88
ARG BUILD_DATE
@@ -29,8 +29,8 @@ RUN \
2929
apt-get install -y --no-install-recommends \
3030
imagemagick \
3131
ghostscript \
32-
libldap-2.5-0 \
33-
libmagic1 \
32+
libldap2 \
33+
libmagic1t64 \
3434
libsasl2-2 \
3535
libxi6 \
3636
libxslt1.1 \

Jenkinsfile

+17-11
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pipeline {
3636
CI_PORT='8083'
3737
CI_SSL='false'
3838
CI_DELAY='120'
39-
CI_DOCKERENV='TZ=US/Pacific'
39+
CI_DOCKERENV='TZ=America/Los_Angeles'
4040
CI_AUTH='user:password'
4141
CI_WEBPATH=''
4242
}
@@ -351,7 +351,7 @@ pipeline {
351351
echo "Starting Stage 2.5 - Update init diagram"
352352
if ! grep -q 'init_diagram:' readme-vars.yml; then
353353
echo "Adding the key 'init_diagram' to readme-vars.yml"
354-
sed -i '\\|^#.*changelog.*$|d' readme-vars.yml
354+
sed -i '\\|^#.*changelog.*$|d' readme-vars.yml
355355
sed -i 's|^changelogs:|# init diagram\\ninit_diagram:\\n\\n# changelog\\nchangelogs:|' readme-vars.yml
356356
fi
357357
mkdir -p ${TEMPDIR}/d2
@@ -585,7 +585,7 @@ pipeline {
585585
--label \"org.opencontainers.image.title=Calibre-web\" \
586586
--label \"org.opencontainers.image.description=[Calibre-web](https://github.com/janeczku/calibre-web) is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. It is also possible to integrate google drive and edit metadata and your calibre library through the app itself. This software is a fork of library and licensed under the GPL v3 License. \" \
587587
--no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \
588-
--provenance=false --sbom=false --builder=container --load \
588+
--provenance=true --sbom=true --builder=container --load \
589589
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
590590
sh '''#! /bin/bash
591591
set -e
@@ -614,7 +614,9 @@ pipeline {
614614
for i in "${CACHE[@]}"; do
615615
docker push ${i}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} &
616616
done
617-
wait
617+
for p in $(jobs -p); do
618+
wait "$p" || { echo "job $p failed" >&2; exit 1; }
619+
done
618620
fi
619621
'''
620622
}
@@ -649,7 +651,7 @@ pipeline {
649651
--label \"org.opencontainers.image.title=Calibre-web\" \
650652
--label \"org.opencontainers.image.description=[Calibre-web](https://github.com/janeczku/calibre-web) is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. It is also possible to integrate google drive and edit metadata and your calibre library through the app itself. This software is a fork of library and licensed under the GPL v3 License. \" \
651653
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \
652-
--provenance=false --sbom=false --builder=container --load \
654+
--provenance=true --sbom=true --builder=container --load \
653655
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
654656
sh '''#! /bin/bash
655657
set -e
@@ -678,7 +680,9 @@ pipeline {
678680
for i in "${CACHE[@]}"; do
679681
docker push ${i}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} &
680682
done
681-
wait
683+
for p in $(jobs -p); do
684+
wait "$p" || { echo "job $p failed" >&2; exit 1; }
685+
done
682686
fi
683687
'''
684688
}
@@ -706,7 +710,7 @@ pipeline {
706710
--label \"org.opencontainers.image.title=Calibre-web\" \
707711
--label \"org.opencontainers.image.description=[Calibre-web](https://github.com/janeczku/calibre-web) is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database. It is also possible to integrate google drive and edit metadata and your calibre library through the app itself. This software is a fork of library and licensed under the GPL v3 License. \" \
708712
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \
709-
--provenance=false --sbom=false --builder=container --load \
713+
--provenance=true --sbom=true --builder=container --load \
710714
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
711715
sh '''#! /bin/bash
712716
set -e
@@ -735,7 +739,9 @@ pipeline {
735739
for i in "${CACHE[@]}"; do
736740
docker push ${i}:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} &
737741
done
738-
wait
742+
for p in $(jobs -p); do
743+
wait "$p" || { echo "job $p failed" >&2; exit 1; }
744+
done
739745
fi
740746
'''
741747
}
@@ -899,15 +905,15 @@ pipeline {
899905
retry_backoff(5,5) {
900906
sh '''#! /bin/bash
901907
set -e
902-
for PUSHIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${QUAYIMAGE}" "${IMAGE}"; do
908+
for PUSHIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do
903909
[[ ${PUSHIMAGE%%/*} =~ \\. ]] && PUSHIMAGEPLUS="${PUSHIMAGE}" || PUSHIMAGEPLUS="docker.io/${PUSHIMAGE}"
904910
IFS=',' read -ra CACHE <<< "$BUILDCACHE"
905911
for i in "${CACHE[@]}"; do
906912
if [[ "${PUSHIMAGEPLUS}" == "$(cut -d "/" -f1 <<< ${i})"* ]]; then
907913
CACHEIMAGE=${i}
908914
fi
909915
done
910-
docker buildx imagetools create --prefer-index=false -t ${PUSHIMAGE}:${META_TAG} -t ${PUSHIMAGE}:latest -t {PUSHIMAGE}:${EXT_RELEASE_TAG} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER}
916+
docker buildx imagetools create --prefer-index=false -t ${PUSHIMAGE}:${META_TAG} -t ${PUSHIMAGE}:latest -t ${PUSHIMAGE}:${EXT_RELEASE_TAG} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER}
911917
if [ -n "${SEMVER}" ]; then
912918
docker buildx imagetools create --prefer-index=false -t ${PUSHIMAGE}:${SEMVER} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER}
913919
fi
@@ -978,7 +984,7 @@ pipeline {
978984
echo '{"tag_name":"'${META_TAG}'",\
979985
"target_commitish": "master",\
980986
"name": "'${META_TAG}'",\
981-
"body": "**CI Report:**\\n\\n'${CI_URL:-N/A}'\\n\\n**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**'${EXT_REPO}' Changes:**\\n\\n' > start
987+
"body": "**CI Report:**\\n\\n'${CI_URL:-N/A}'\\n\\n**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**Remote Changes:**\\n\\n' > start
982988
printf '","draft": false,"prerelease": false}' >> releasebody.json
983989
paste -d'\\0' start releasebody.json > releasebody.json.done
984990
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
313313

314314
## Versions
315315

316+
* **05.12.24:** - Rebase to noble.
316317
* **26.08.24:** - Add new dep, xdg-utils.
317318
* **07.07.24:** - Add new dep, libmagic1.
318319
* **17.10.23:** - Remove some packages that are required by the calibre mod but not the base container.

jenkins-vars.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ repo_vars:
2525
- CI_PORT='8083'
2626
- CI_SSL='false'
2727
- CI_DELAY='120'
28-
- CI_DOCKERENV='TZ=US/Pacific'
28+
- CI_DOCKERENV='TZ=America/Los_Angeles'
2929
- CI_AUTH='user:password'
3030
- CI_WEBPATH=''

0 commit comments

Comments
 (0)