Skip to content

Commit 6daee44

Browse files
authored
Merge pull request #4 from linuxserver/ingestion-fix
update ingestion to use github
2 parents 8d35d87 + 77fd5be commit 6daee44

4 files changed

Lines changed: 30 additions & 20 deletions

File tree

.github/workflows/external_trigger.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
3030
echo "> External trigger running off of master branch. To disable this trigger, add \`scummvm_master\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
3131
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
32-
EXT_RELEASE=$(curl -s https://downloads.scummvm.org/frs/scummvm/ | awk -F'(<a href="|/">)' '{print $2}'| grep -B 1 'daily' |head -n1)
33-
echo "Type is \`custom_version_command\`" >> $GITHUB_STEP_SUMMARY
32+
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/scummvm/scummvm/releases/latest" | jq -r '. | .tag_name')
33+
echo "Type is \`github_stable\`" >> $GITHUB_STEP_SUMMARY
3434
if grep -q "^scummvm_master_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
3535
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3636
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY
@@ -110,7 +110,7 @@ jobs:
110110
echo "New version \`${EXT_RELEASE}\` found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY
111111
exit 0
112112
else
113-
if curl -IfSsL "https://downloads.scummvm.org/frs/scummvm/${EXT_RELEASE}/scummvm_${EXT_RELEASE}-1_ubuntu24_04_amd64.deb" > /dev/null 2>&1; then
113+
if curl -IfSsL "https://downloads.scummvm.org/frs/scummvm/$(echo ${EXT_RELEASE}| sed 's/^v//g')/scummvm_$(echo ${EXT_RELEASE}| sed 's/^v//g')-1_ubuntu24_04_amd64.deb" > /dev/null 2>&1; then
114114
artifacts_found="true"
115115
else
116116
artifacts_found="false"

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ RUN \
1818
https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/scummvm-logo.png && \
1919
echo "**** install packages ****" && \
2020
if [ -z "${SCUMMVM_VERSION+x}" ]; then \
21-
SCUMMVM_VERSION=$(curl -s https://downloads.scummvm.org/frs/scummvm/ \
22-
| awk -F'(<a href="|/">)' '{print $2}'| grep -B 1 'daily' |head -n1); \
21+
SCUMMVM_VERSION=$(curl -sX GET "https://api.github.com/repos/scummvm/scummvm/releases/latest" \
22+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
2323
fi && \
2424
curl -o \
2525
/tmp/scummvm.deb -L \
26-
"https://downloads.scummvm.org/frs/scummvm/${SCUMMVM_VERSION}/scummvm_${SCUMMVM_VERSION}-1_ubuntu24_04_amd64.deb" && \
26+
"https://downloads.scummvm.org/frs/scummvm/$(echo ${SCUMMVM_VERSION} | sed 's/^v//g')/scummvm_$(echo ${SCUMMVM_VERSION} | sed 's/^v//g')-1_ubuntu24_04_amd64.deb" && \
2727
apt-get update && \
2828
apt-get install -y \
2929
/tmp/scummvm.deb && \

Jenkinsfile

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ pipeline {
1919
DOCKERHUB_TOKEN=credentials('docker-hub-ci-pat')
2020
QUAYIO_API_TOKEN=credentials('quayio-repo-api-token')
2121
GIT_SIGNING_KEY=credentials('484fbca6-9a4f-455e-b9e3-97ac98785f5f')
22+
EXT_USER = 'scummvm'
23+
EXT_REPO = 'scummvm'
2224
BUILD_VERSION_ARG = 'SCUMMVM_VERSION'
2325
LS_USER = 'linuxserver'
2426
LS_REPO = 'docker-scummvm'
@@ -143,16 +145,23 @@ pipeline {
143145
/* ########################
144146
External Release Tagging
145147
######################## */
146-
// If this is a custom command to determine version use that command
147-
stage("Set tag custom bash"){
148-
steps{
149-
script{
150-
env.EXT_RELEASE = sh(
151-
script: ''' curl -s https://downloads.scummvm.org/frs/scummvm/ | awk -F'(<a href="|/">)' '{print $2}'| grep -B 1 'daily' |head -n1 ''',
152-
returnStdout: true).trim()
153-
env.RELEASE_LINK = 'custom_command'
154-
}
155-
}
148+
// If this is a stable github release use the latest endpoint from github to determine the ext tag
149+
stage("Set ENV github_stable"){
150+
steps{
151+
script{
152+
env.EXT_RELEASE = sh(
153+
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
154+
returnStdout: true).trim()
155+
}
156+
}
157+
}
158+
// If this is a stable or devel github release generate the link for the build message
159+
stage("Set ENV github_link"){
160+
steps{
161+
script{
162+
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
163+
}
164+
}
156165
}
157166
// Sanitize the release tag and strip illegal docker or github characters
158167
stage("Sanitize tag"){
@@ -1022,7 +1031,7 @@ pipeline {
10221031
"type": "commit",\
10231032
"tagger": {"name": "LinuxServer-CI","email": "[email protected]","date": "'${GITHUB_DATE}'"}}'
10241033
echo "Pushing New release for Tag"
1025-
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
1034+
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. |.body' > releasebody.json
10261035
jq -n \
10271036
--arg tag_name "$META_TAG" \
10281037
--arg target_commitish "master" \

jenkins-vars.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
# jenkins variables
44
project_name: docker-scummvm
5-
external_type: na
6-
custom_version_command: "curl -s https://downloads.scummvm.org/frs/scummvm/ | awk -F'(<a href=\"|/\">)' '{print $2}'| grep -B 1 'daily' |head -n1"
5+
external_type: github_stable
76
external_artifact_check: |
8-
if curl -IfSsL "https://downloads.scummvm.org/frs/scummvm/${EXT_RELEASE}/scummvm_${EXT_RELEASE}-1_ubuntu24_04_amd64.deb" > /dev/null 2>&1; then
7+
if curl -IfSsL "https://downloads.scummvm.org/frs/scummvm/$(echo ${EXT_RELEASE}| sed 's/^v//g')/scummvm_$(echo ${EXT_RELEASE}| sed 's/^v//g')-1_ubuntu24_04_amd64.deb" > /dev/null 2>&1; then
98
artifacts_found="true"
109
else
1110
artifacts_found="false"
@@ -15,6 +14,8 @@ release_tag: latest
1514
ls_branch: master
1615
build_armhf: false
1716
repo_vars:
17+
- EXT_USER = 'scummvm'
18+
- EXT_REPO = 'scummvm'
1819
- BUILD_VERSION_ARG = 'SCUMMVM_VERSION'
1920
- LS_USER = 'linuxserver'
2021
- LS_REPO = 'docker-scummvm'

0 commit comments

Comments
 (0)