@@ -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": "jenkins@linuxserver.io","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}'",\
0 commit comments