Skip to content

Commit 369e067

Browse files
authored
Merge pull request #6 from linuxserver/selkies
Selkies rebase - Debian Trixie - Install resynthisizer
2 parents 8bf6937 + 343ab3d commit 369e067

File tree

8 files changed

+164
-222
lines changed

8 files changed

+164
-222
lines changed

.github/workflows/external_trigger.yml

Lines changed: 3 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -18,138 +18,11 @@ jobs:
1818
SKIP_EXTERNAL_TRIGGER: ${{ vars.SKIP_EXTERNAL_TRIGGER }}
1919
run: |
2020
printf "# External trigger for docker-gimp\n\n" >> $GITHUB_STEP_SUMMARY
21-
if grep -q "^gimp_master_" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
22-
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
23-
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`gimp_master_\`; will skip trigger if version matches." >> $GITHUB_STEP_SUMMARY
24-
elif grep -q "^gimp_master" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
25-
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
26-
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`gimp_master\`; skipping trigger." >> $GITHUB_STEP_SUMMARY
27-
exit 0
28-
fi
29-
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
30-
echo "> External trigger running off of master branch. To disable this trigger, add \`gimp_master\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
31-
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
32-
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.21/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
33-
&& awk '/^P:'"gimp"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
34-
echo "Type is \`alpine_repo\`" >> $GITHUB_STEP_SUMMARY
21+
echo "Type is \`os\`" >> $GITHUB_STEP_SUMMARY
22+
echo "No external release, exiting" >> $GITHUB_STEP_SUMMARY
23+
exit 0
3524
if grep -q "^gimp_master_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
3625
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3726
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY
3827
exit 0
3928
fi
40-
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
41-
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
42-
echo "> Can't retrieve external version, exiting" >> $GITHUB_STEP_SUMMARY
43-
FAILURE_REASON="Can't retrieve external version for gimp branch master"
44-
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-gimp/actions/runs/${{ github.run_id }}"
45-
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
46-
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}],
47-
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
48-
exit 1
49-
fi
50-
EXT_RELEASE_SANITIZED=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
51-
echo "Sanitized external version: \`${EXT_RELEASE_SANITIZED}\`" >> $GITHUB_STEP_SUMMARY
52-
echo "Retrieving last pushed version" >> $GITHUB_STEP_SUMMARY
53-
image="linuxserver/gimp"
54-
tag="latest"
55-
token=$(curl -sX GET \
56-
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fgimp%3Apull" \
57-
| jq -r '.token')
58-
multidigest=$(curl -s \
59-
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
60-
--header "Accept: application/vnd.oci.image.index.v1+json" \
61-
--header "Authorization: Bearer ${token}" \
62-
"https://ghcr.io/v2/${image}/manifests/${tag}")
63-
if jq -e '.layers // empty' <<< "${multidigest}" >/dev/null 2>&1; then
64-
# If there's a layer element it's a single-arch manifest so just get that digest
65-
digest=$(jq -r '.config.digest' <<< "${multidigest}")
66-
else
67-
# Otherwise it's multi-arch or has manifest annotations
68-
if jq -e '.manifests[]?.annotations // empty' <<< "${multidigest}" >/dev/null 2>&1; then
69-
# Check for manifest annotations and delete if found
70-
multidigest=$(jq 'del(.manifests[] | select(.annotations))' <<< "${multidigest}")
71-
fi
72-
if [[ $(jq '.manifests | length' <<< "${multidigest}") -gt 1 ]]; then
73-
# If there's still more than one digest, it's multi-arch
74-
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
75-
else
76-
# Otherwise it's single arch
77-
multidigest=$(jq -r ".manifests[].digest?" <<< "${multidigest}")
78-
fi
79-
if digest=$(curl -s \
80-
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
81-
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
82-
--header "Authorization: Bearer ${token}" \
83-
"https://ghcr.io/v2/${image}/manifests/${multidigest}"); then
84-
digest=$(jq -r '.config.digest' <<< "${digest}");
85-
fi
86-
fi
87-
image_info=$(curl -sL \
88-
--header "Authorization: Bearer ${token}" \
89-
"https://ghcr.io/v2/${image}/blobs/${digest}")
90-
if [[ $(echo $image_info | jq -r '.container_config') == "null" ]]; then
91-
image_info=$(echo $image_info | jq -r '.config')
92-
else
93-
image_info=$(echo $image_info | jq -r '.container_config')
94-
fi
95-
IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}')
96-
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
97-
if [ -z "${IMAGE_VERSION}" ]; then
98-
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
99-
echo "Can't retrieve last pushed version, exiting" >> $GITHUB_STEP_SUMMARY
100-
FAILURE_REASON="Can't retrieve last pushed version for gimp tag latest"
101-
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
102-
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
103-
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
104-
exit 1
105-
fi
106-
echo "Last pushed version: \`${IMAGE_VERSION}\`" >> $GITHUB_STEP_SUMMARY
107-
if [ "${EXT_RELEASE_SANITIZED}" == "${IMAGE_VERSION}" ]; then
108-
echo "Sanitized version \`${EXT_RELEASE_SANITIZED}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY
109-
exit 0
110-
elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.21/community/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"gimp"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then
111-
echo "New version \`${EXT_RELEASE}\` found; but not all arch repos updated yet; exiting" >> $GITHUB_STEP_SUMMARY
112-
FAILURE_REASON="New version ${EXT_RELEASE} for gimp tag latest is detected, however not all arch repos are updated yet. Will try again later."
113-
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
114-
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
115-
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
116-
exit 0
117-
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-gimp/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
118-
echo "New version \`${EXT_RELEASE}\` found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY
119-
exit 0
120-
else
121-
if [[ "${artifacts_found}" == "false" ]]; then
122-
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
123-
echo "> New version detected, but not all artifacts are published yet; skipping trigger" >> $GITHUB_STEP_SUMMARY
124-
FAILURE_REASON="New version ${EXT_RELEASE} for gimp tag latest is detected, however not all artifacts are uploaded to upstream release yet. Will try again later."
125-
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
126-
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
127-
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
128-
else
129-
printf "\n## Trigger new build\n\n" >> $GITHUB_STEP_SUMMARY
130-
echo "New sanitized version \`${EXT_RELEASE_SANITIZED}\` found; old version was \`${IMAGE_VERSION}\`. Triggering new build" >> $GITHUB_STEP_SUMMARY
131-
if [[ "${artifacts_found}" == "true" ]]; then
132-
echo "All artifacts seem to be uploaded." >> $GITHUB_STEP_SUMMARY
133-
fi
134-
response=$(curl -iX POST \
135-
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-gimp/job/master/buildWithParameters?PACKAGE_CHECK=false \
136-
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
137-
echo "Jenkins [job queue url](${response%$'\r'})" >> $GITHUB_STEP_SUMMARY
138-
echo "Sleeping 10 seconds until job starts" >> $GITHUB_STEP_SUMMARY
139-
sleep 10
140-
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
141-
buildurl="${buildurl%$'\r'}"
142-
echo "Jenkins job [build url](${buildurl})" >> $GITHUB_STEP_SUMMARY
143-
echo "Attempting to change the Jenkins job description" >> $GITHUB_STEP_SUMMARY
144-
curl -iX POST \
145-
"${buildurl}submitDescription" \
146-
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
147-
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
148-
--data-urlencode "Submit=Submit"
149-
echo "**** Notifying Discord ****"
150-
TRIGGER_REASON="A version change was detected for gimp tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE_SANITIZED}"
151-
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
152-
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
153-
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
154-
fi
155-
fi

Dockerfile

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
1-
FROM ghcr.io/linuxserver/baseimage-kasmvnc:alpine321
1+
FROM ghcr.io/linuxserver/baseimage-debian:trixie AS resynth
2+
3+
RUN \
4+
echo "**** install build deps ****" && \
5+
apt-get update && \
6+
apt-get install -y \
7+
build-essential \
8+
libgimp-3.0-dev \
9+
meson
10+
11+
RUN \
12+
echo "**** ingest and build resynthesizer ****" && \
13+
mkdir /buildout && \
14+
RESYNTH_RELEASE=$(curl -sX GET "https://api.github.com/repos/bootchk/resynthesizer/releases/latest" \
15+
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
16+
curl -o \
17+
/tmp/resynth.tar.gz -L \
18+
"https://github.com/bootchk/resynthesizer/archive/refs/tags/${RESYNTH_RELEASE}.tar.gz" && \
19+
cd /tmp && \
20+
tar -xf resynth.tar.gz && \
21+
cd resynthesizer-* && \
22+
meson setup resynthesizerBuild && \
23+
cd resynthesizerBuild && \
24+
meson compile --verbose -j $(nproc) && \
25+
DESTDIR=/buildout meson install && \
26+
mv /buildout/usr/local/lib /buildout/usr && \
27+
rm -Rf /buildout/usr/local
28+
29+
# runtime stage
30+
FROM ghcr.io/linuxserver/baseimage-selkies:debiantrixie
231

332
# set version label
433
ARG BUILD_DATE
@@ -8,25 +37,28 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
837
LABEL maintainer="thelamer"
938

1039
# title
11-
ENV TITLE=GIMP
40+
ENV TITLE=GIMP \
41+
NO_FULL=true
1242

1343
RUN \
1444
echo "**** add icon ****" && \
1545
curl -o \
16-
/kclient/public/icon.png \
46+
/usr/share/selkies/www/icon.png \
1747
https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/gimp-logo.png && \
1848
echo "**** install packages ****" && \
19-
if [ -z ${GIMP_VERSION+x} ]; then \
20-
GIMP_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.21/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
21-
&& awk '/^P:gimp$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
22-
fi && \
23-
apk add --no-cache \
24-
gimp==${GIMP_VERSION} && \
49+
apt-get update && \
50+
apt-get install -y \
51+
gimp \
52+
libgimp-3.0 && \
2553
echo "**** cleanup ****" && \
54+
apt-get autoclean && \
2655
rm -rf \
56+
/var/lib/apt/lists/* \
57+
/var/tmp/* \
2758
/tmp/*
2859

2960
# add local files
61+
COPY --from=resynth /buildout /
3062
COPY /root /
3163

3264
# ports and volumes

Dockerfile.aarch64

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
1-
FROM ghcr.io/linuxserver/baseimage-kasmvnc:arm64v8-alpine321
1+
FROM ghcr.io/linuxserver/baseimage-debian:arm64v8-trixie AS resynth
2+
3+
RUN \
4+
echo "**** install build deps ****" && \
5+
apt-get update && \
6+
apt-get install -y \
7+
build-essential \
8+
libgimp-3.0-dev \
9+
meson
10+
11+
RUN \
12+
echo "**** ingest and build resynthesizer ****" && \
13+
mkdir /buildout && \
14+
RESYNTH_RELEASE=$(curl -sX GET "https://api.github.com/repos/bootchk/resynthesizer/releases/latest" \
15+
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
16+
curl -o \
17+
/tmp/resynth.tar.gz -L \
18+
"https://github.com/bootchk/resynthesizer/archive/refs/tags/${RESYNTH_RELEASE}.tar.gz" && \
19+
cd /tmp && \
20+
tar -xf resynth.tar.gz && \
21+
cd resynthesizer-* && \
22+
meson setup resynthesizerBuild && \
23+
cd resynthesizerBuild && \
24+
meson compile --verbose -j $(nproc) && \
25+
DESTDIR=/buildout meson install && \
26+
mv /buildout/usr/local/lib /buildout/usr && \
27+
rm -Rf /buildout/usr/local
28+
29+
# runtime stage
30+
FROM ghcr.io/linuxserver/baseimage-selkies:arm64v8-debiantrixie
231

332
# set version label
433
ARG BUILD_DATE
@@ -8,25 +37,28 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
837
LABEL maintainer="thelamer"
938

1039
# title
11-
ENV TITLE=GIMP
40+
ENV TITLE=GIMP \
41+
NO_FULL=true
1242

1343
RUN \
1444
echo "**** add icon ****" && \
1545
curl -o \
16-
/kclient/public/icon.png \
46+
/usr/share/selkies/www/icon.png \
1747
https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/gimp-logo.png && \
1848
echo "**** install packages ****" && \
19-
if [ -z ${GIMP_VERSION+x} ]; then \
20-
GIMP_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.21/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
21-
&& awk '/^P:gimp$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
22-
fi && \
23-
apk add --no-cache \
24-
gimp==${GIMP_VERSION} && \
49+
apt-get update && \
50+
apt-get install -y \
51+
gimp \
52+
libgimp-3.0 && \
2553
echo "**** cleanup ****" && \
54+
apt-get autoclean && \
2655
rm -rf \
56+
/var/lib/apt/lists/* \
57+
/var/tmp/* \
2758
/tmp/*
2859

2960
# add local files
61+
COPY --from=resynth /buildout /
3062
COPY /root /
3163

3264
# ports and volumes

Jenkinsfile

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,12 @@ pipeline {
2626
DOCKERHUB_IMAGE = 'linuxserver/gimp'
2727
DEV_DOCKERHUB_IMAGE = 'lsiodev/gimp'
2828
PR_DOCKERHUB_IMAGE = 'lspipepr/gimp'
29-
DIST_IMAGE = 'alpine'
30-
DIST_TAG = '3.21'
31-
DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.21/community/'
32-
DIST_REPO_PACKAGES = 'gimp'
29+
DIST_IMAGE = 'ubuntu'
3330
MULTIARCH = 'true'
3431
CI = 'true'
3532
CI_WEB = 'true'
36-
CI_PORT = '3000'
37-
CI_SSL = 'false'
33+
CI_PORT = '3001'
34+
CI_SSL = 'true'
3835
CI_DELAY = '120'
3936
CI_DOCKERENV = 'TZ=US/Pacific'
4037
CI_AUTH = 'user:password'
@@ -145,15 +142,12 @@ pipeline {
145142
/* ########################
146143
External Release Tagging
147144
######################## */
148-
// If this is an alpine repo change for external version determine an md5 from the version string
149-
stage("Set tag Alpine Repo"){
145+
// If this is an os release set release type to none to indicate no external release
146+
stage("Set ENV os"){
150147
steps{
151148
script{
152-
env.EXT_RELEASE = sh(
153-
script: '''curl -sL "${DIST_REPO}x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
154-
&& awk '/^P:'"${DIST_REPO_PACKAGES}"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://' ''',
155-
returnStdout: true).trim()
156-
env.RELEASE_LINK = 'alpine_repo'
149+
env.EXT_RELEASE = env.PACKAGE_TAG
150+
env.RELEASE_LINK = 'none'
157151
}
158152
}
159153
}
@@ -992,7 +986,7 @@ pipeline {
992986
"tagger": {"name": "LinuxServer-CI","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
993987
echo "Pushing New release for Tag"
994988
sh '''#! /bin/bash
995-
echo "Updating external repo packages to ${EXT_RELEASE_CLEAN}" > releasebody.json
989+
echo "Updating base packages to ${PACKAGE_TAG}" > releasebody.json
996990
echo '{"tag_name":"'${META_TAG}'",\
997991
"target_commitish": "master",\
998992
"name": "'${META_TAG}'",\

0 commit comments

Comments
 (0)