Skip to content

Commit 493cad6

Browse files
Bot Updating Templated Files
1 parent 194a638 commit 493cad6

File tree

3 files changed

+48
-14
lines changed

3 files changed

+48
-14
lines changed

.github/workflows/external_trigger.yml

+25-8
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,30 @@ jobs:
4949
--header "Accept: application/vnd.oci.image.index.v1+json" \
5050
--header "Authorization: Bearer ${token}" \
5151
"https://ghcr.io/v2/${image}/manifests/${tag}")
52-
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
53-
digest=$(curl -s \
54-
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
55-
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
56-
--header "Authorization: Bearer ${token}" \
57-
"https://ghcr.io/v2/${image}/manifests/${multidigest}" \
58-
| jq -r '.config.digest')
52+
if jq -e '.layers // empty' <<< "${multidigest}" >/dev/null 2>&1; then
53+
# If there's a layer element it's a single-arch manifest so just get that digest
54+
digest=$(jq -r '.config.digest' <<< "${multidigest}")
55+
else
56+
# Otherwise it's multi-arch or has manifest annotations
57+
if jq -e '.manifests[]?.annotations // empty' <<< "${multidigest}" >/dev/null 2>&1; then
58+
# Check for manifest annotations and delete if found
59+
multidigest=$(jq 'del(.manifests[] | select(.annotations))' <<< "${multidigest}")
60+
fi
61+
if [[ $(jq '.manifests | length' <<< "${multidigest}") -gt 1 ]]; then
62+
# If there's still more than one digest, it's multi-arch
63+
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
64+
else
65+
# Otherwise it's single arch
66+
multidigest=$(jq -r ".manifests[].digest?" <<< "${multidigest}")
67+
fi
68+
if digest=$(curl -s \
69+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
70+
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
71+
--header "Authorization: Bearer ${token}" \
72+
"https://ghcr.io/v2/${image}/manifests/${multidigest}"); then
73+
digest=$(jq -r '.config.digest' <<< "${digest}");
74+
fi
75+
fi
5976
image_info=$(curl -sL \
6077
--header "Authorization: Bearer ${token}" \
6178
"https://ghcr.io/v2/${image}/blobs/${digest}")
@@ -100,7 +117,7 @@ jobs:
100117
else
101118
printf "\n## Trigger new build\n\n" >> $GITHUB_STEP_SUMMARY
102119
echo "New version \`${EXT_RELEASE}\` found; old version was \`${IMAGE_VERSION}\`. Triggering new build" >> $GITHUB_STEP_SUMMARY
103-
if "${artifacts_found}" == "true" ]]; then
120+
if [[ "${artifacts_found}" == "true" ]]; then
104121
echo "All artifacts seem to be uploaded." >> $GITHUB_STEP_SUMMARY
105122
fi
106123
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-gimp/${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-gimp/${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-gimp/${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 "^gimp_${br}" <<< "${SKIP_PACKAGE_TRIGGER}"; then
3746
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3847
echo "> Github organizational variable \`SKIP_PACKAGE_TRIGGER\` contains \`gimp_${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-gimp/job/${br}/lastBuild/api/json | jq -r '.building') == "true" ]; then
49+
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-gimp/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-gimp/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

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ To install cjk fonts on startup as an example pass the environment variables (Al
117117

118118
The web interface has the option for "IME Input Mode" in Settings which will allow non english characters to be used from a non en_US keyboard on the client. Once enabled it will perform the same as a local Linux installation set to your locale.
119119

120-
### DRI3 GPU Acceleration
120+
### DRI3 GPU Acceleration (KasmVNC interface)
121121

122122
For accelerated apps or games, render devices can be mounted into the container and leveraged by applications using:
123123

0 commit comments

Comments
 (0)