updating endpoint to specifically hit the computer linux json and using custom_json for versioning
This commit is contained in:
parent
c41d3e05eb
commit
d8254e6bdf
6 changed files with 22 additions and 19 deletions
|
|
@ -36,7 +36,7 @@ RUN \
|
||||||
echo "**** install plex ****" && \
|
echo "**** install plex ****" && \
|
||||||
if [ -z ${PLEX_RELEASE+x} ]; then \
|
if [ -z ${PLEX_RELEASE+x} ]; then \
|
||||||
PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \
|
PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \
|
||||||
| jq -r 'first(.[] | .Linux.version)'); \
|
| jq -r '.computer.Linux.version'); \
|
||||||
fi && \
|
fi && \
|
||||||
curl -o \
|
curl -o \
|
||||||
/tmp/plexmediaserver.deb -L \
|
/tmp/plexmediaserver.deb -L \
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,8 @@ RUN \
|
||||||
chmod +x /sbin/udevadm && \
|
chmod +x /sbin/udevadm && \
|
||||||
echo "**** install plex ****" && \
|
echo "**** install plex ****" && \
|
||||||
if [ -z ${PLEX_RELEASE+x} ]; then \
|
if [ -z ${PLEX_RELEASE+x} ]; then \
|
||||||
PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \
|
PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \
|
||||||
| jq -r 'first(.[] | .Linux.version)'); \
|
| jq -r '.computer.Linux.version'); \
|
||||||
fi && \
|
fi && \
|
||||||
curl -o \
|
curl -o \
|
||||||
/tmp/plexmediaserver.deb -L \
|
/tmp/plexmediaserver.deb -L \
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,8 @@ RUN \
|
||||||
chmod +x /sbin/udevadm && \
|
chmod +x /sbin/udevadm && \
|
||||||
echo "**** install plex ****" && \
|
echo "**** install plex ****" && \
|
||||||
if [ -z ${PLEX_RELEASE+x} ]; then \
|
if [ -z ${PLEX_RELEASE+x} ]; then \
|
||||||
PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \
|
PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \
|
||||||
| jq -r 'first(.[] | .Linux.version)'); \
|
| jq -r '.computer.Linux.version'); \
|
||||||
fi && \
|
fi && \
|
||||||
curl -o \
|
curl -o \
|
||||||
/tmp/plexmediaserver.deb -L \
|
/tmp/plexmediaserver.deb -L \
|
||||||
|
|
|
||||||
24
Jenkinsfile
vendored
24
Jenkinsfile
vendored
|
|
@ -10,6 +10,8 @@ pipeline {
|
||||||
environment {
|
environment {
|
||||||
BUILDS_DISCORD=credentials('build_webhook_url')
|
BUILDS_DISCORD=credentials('build_webhook_url')
|
||||||
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
|
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
|
||||||
|
JSON_URL = 'https://plex.tv/api/downloads/5.json'
|
||||||
|
JSON_PATH = '.computer.Linux.version'
|
||||||
BUILD_VERSION_ARG = 'PLEX_RELEASE'
|
BUILD_VERSION_ARG = 'PLEX_RELEASE'
|
||||||
LS_USER = 'linuxserver'
|
LS_USER = 'linuxserver'
|
||||||
LS_REPO = 'docker-plex'
|
LS_REPO = 'docker-plex'
|
||||||
|
|
@ -91,16 +93,16 @@ pipeline {
|
||||||
/* ########################
|
/* ########################
|
||||||
External Release Tagging
|
External Release Tagging
|
||||||
######################## */
|
######################## */
|
||||||
// If this is a custom command to determine version use that command
|
// If this is a custom json endpoint parse the return to get external tag
|
||||||
stage("Set tag custom bash"){
|
stage("Set ENV custom_json"){
|
||||||
steps{
|
steps{
|
||||||
script{
|
script{
|
||||||
env.EXT_RELEASE = sh(
|
env.EXT_RELEASE = sh(
|
||||||
script: ''' curl -s 'https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&distro=ubuntu' |grep -oP 'version="\\K[^"]+' | tail -n 1 ''',
|
script: '''curl -s ${JSON_URL} | jq -r ". | ${JSON_PATH}" ''',
|
||||||
returnStdout: true).trim()
|
returnStdout: true).trim()
|
||||||
env.RELEASE_LINK = 'custom_command'
|
env.RELEASE_LINK = env.JSON_URL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Sanitize the release tag and strip illegal docker or github characters
|
// Sanitize the release tag and strip illegal docker or github characters
|
||||||
stage("Sanitize tag"){
|
stage("Sanitize tag"){
|
||||||
|
|
@ -558,7 +560,7 @@ pipeline {
|
||||||
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
|
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
|
||||||
echo "Pushing New release for Tag"
|
echo "Pushing New release for Tag"
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
|
echo "Data change at JSON endpoint ${JSON_URL}" > releasebody.json
|
||||||
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
|
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
|
||||||
"target_commitish": "master",\
|
"target_commitish": "master",\
|
||||||
"name": "'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
|
"name": "'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,13 @@
|
||||||
|
|
||||||
# jenkins variables
|
# jenkins variables
|
||||||
project_name: docker-plex
|
project_name: docker-plex
|
||||||
external_type: na
|
external_type: custom_json
|
||||||
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
|
|
||||||
release_type: stable
|
release_type: stable
|
||||||
release_tag: latest
|
release_tag: latest
|
||||||
ls_branch: master
|
ls_branch: master
|
||||||
repo_vars:
|
repo_vars:
|
||||||
|
- JSON_URL = 'https://plex.tv/api/downloads/5.json'
|
||||||
|
- JSON_PATH = '.computer.Linux.version'
|
||||||
- BUILD_VERSION_ARG = 'PLEX_RELEASE'
|
- BUILD_VERSION_ARG = 'PLEX_RELEASE'
|
||||||
- LS_USER = 'linuxserver'
|
- LS_USER = 'linuxserver'
|
||||||
- LS_REPO = 'docker-plex'
|
- LS_REPO = 'docker-plex'
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ if [[ "${VERSION,,}" = latest ]] || [[ "${VERSION,,}" = plexpass ]] || [[ "$PLEX
|
||||||
fi
|
fi
|
||||||
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 )
|
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 )
|
||||||
elif [[ "${VERSION,,}" = public ]]; then
|
elif [[ "${VERSION,,}" = public ]]; then
|
||||||
REMOTE_VERSION=curl -sX GET 'https://plex.tv/api/downloads/5.json' | jq -r 'first(.[] | .Linux.version)'
|
REMOTE_VERSION=curl -sX GET 'https://plex.tv/api/downloads/5.json' | jq -r '.computer.Linux.version'
|
||||||
else
|
else
|
||||||
REMOTE_VERSION="${VERSION}"
|
REMOTE_VERSION="${VERSION}"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue