Skip to content

Commit d8254e6

Browse files
committed
updating endpoint to specifically hit the computer linux json and using custom_json for versioning
1 parent c41d3e0 commit d8254e6

File tree

6 files changed

+22
-19
lines changed

6 files changed

+22
-19
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ RUN \
3636
echo "**** install plex ****" && \
3737
if [ -z ${PLEX_RELEASE+x} ]; then \
3838
PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \
39-
| jq -r 'first(.[] | .Linux.version)'); \
39+
| jq -r '.computer.Linux.version'); \
4040
fi && \
4141
curl -o \
4242
/tmp/plexmediaserver.deb -L \

Dockerfile.aarch64

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ RUN \
3535
chmod +x /sbin/udevadm && \
3636
echo "**** install plex ****" && \
3737
if [ -z ${PLEX_RELEASE+x} ]; then \
38-
PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \
39-
| jq -r 'first(.[] | .Linux.version)'); \
38+
PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \
39+
| jq -r '.computer.Linux.version'); \
4040
fi && \
4141
curl -o \
4242
/tmp/plexmediaserver.deb -L \

Dockerfile.armhf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ RUN \
3535
chmod +x /sbin/udevadm && \
3636
echo "**** install plex ****" && \
3737
if [ -z ${PLEX_RELEASE+x} ]; then \
38-
PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \
39-
| jq -r 'first(.[] | .Linux.version)'); \
38+
PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \
39+
| jq -r '.computer.Linux.version'); \
4040
fi && \
4141
curl -o \
4242
/tmp/plexmediaserver.deb -L \

Jenkinsfile

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ pipeline {
1010
environment {
1111
BUILDS_DISCORD=credentials('build_webhook_url')
1212
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
13+
JSON_URL = 'https://plex.tv/api/downloads/5.json'
14+
JSON_PATH = '.computer.Linux.version'
1315
BUILD_VERSION_ARG = 'PLEX_RELEASE'
1416
LS_USER = 'linuxserver'
1517
LS_REPO = 'docker-plex'
@@ -91,16 +93,16 @@ pipeline {
9193
/* ########################
9294
External Release Tagging
9395
######################## */
94-
// If this is a custom command to determine version use that command
95-
stage("Set tag custom bash"){
96-
steps{
97-
script{
98-
env.EXT_RELEASE = sh(
99-
script: ''' curl -s 'https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&distro=ubuntu' |grep -oP 'version="\\K[^"]+' | tail -n 1 ''',
100-
returnStdout: true).trim()
101-
env.RELEASE_LINK = 'custom_command'
102-
}
103-
}
96+
// If this is a custom json endpoint parse the return to get external tag
97+
stage("Set ENV custom_json"){
98+
steps{
99+
script{
100+
env.EXT_RELEASE = sh(
101+
script: '''curl -s ${JSON_URL} | jq -r ". | ${JSON_PATH}" ''',
102+
returnStdout: true).trim()
103+
env.RELEASE_LINK = env.JSON_URL
104+
}
105+
}
104106
}
105107
// Sanitize the release tag and strip illegal docker or github characters
106108
stage("Sanitize tag"){
@@ -558,7 +560,7 @@ pipeline {
558560
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
559561
echo "Pushing New release for Tag"
560562
sh '''#! /bin/bash
561-
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
563+
echo "Data change at JSON endpoint ${JSON_URL}" > releasebody.json
562564
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
563565
"target_commitish": "master",\
564566
"name": "'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\

jenkins-vars.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
# jenkins variables
44
project_name: docker-plex
5-
external_type: na
6-
custom_version_command: curl -s 'https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&distro=ubuntu' |grep -oP 'version="\\K[^"]+' | tail -n 1
5+
external_type: custom_json
76
release_type: stable
87
release_tag: latest
98
ls_branch: master
109
repo_vars:
10+
- JSON_URL = 'https://plex.tv/api/downloads/5.json'
11+
- JSON_PATH = '.computer.Linux.version'
1112
- BUILD_VERSION_ARG = 'PLEX_RELEASE'
1213
- LS_USER = 'linuxserver'
1314
- LS_REPO = 'docker-plex'

root/etc/cont-init.d/60-plex-update

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ if [[ "${VERSION,,}" = latest ]] || [[ "${VERSION,,}" = plexpass ]] || [[ "$PLEX
100100
fi
101101
REMOTE_VERSION=$(curl -s "https://plex.tv/downloads/details/5?distro=debian&build=linux-${PLEX_URL_ARCH}&channel=8&X-Plex-Token=$PLEX_TOKEN"| grep -oP 'version="\K[^"]+' | tail -n 1 )
102102
elif [[ "${VERSION,,}" = public ]]; then
103-
REMOTE_VERSION=curl -sX GET 'https://plex.tv/api/downloads/5.json' | jq -r 'first(.[] | .Linux.version)'
103+
REMOTE_VERSION=curl -sX GET 'https://plex.tv/api/downloads/5.json' | jq -r '.computer.Linux.version'
104104
else
105105
REMOTE_VERSION="${VERSION}"
106106
fi

0 commit comments

Comments
 (0)