diff --git a/Dockerfile b/Dockerfile index ca9d0d3..924882e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,8 @@ ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" # global environment settings ENV DEBIAN_FRONTEND="noninteractive" \ -PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server" \ -PLEX_INSTALL="https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu" \ +PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server-new" \ +PLEX_ARCH="amd64" \ PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/config/Library/Application Support" \ PLEX_MEDIA_SERVER_HOME="/usr/lib/plexmediaserver" \ PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS="6" \ @@ -28,19 +28,19 @@ RUN \ udev \ unrar \ wget \ - jq && \ + jq && \ echo "**** Udevadm hack ****" && \ mv /sbin/udevadm /sbin/udevadm.bak && \ echo "exit 0" > /sbin/udevadm && \ chmod +x /sbin/udevadm && \ echo "**** install plex ****" && \ if [ -z ${PLEX_RELEASE+x} ]; then \ - PLEX_RELEASE=$(curl -s 'https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&distro=ubuntu' \ - |grep -oP 'version="\K[^"]+' | tail -n 1); \ + PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \ + | jq -r '.computer.Linux.version'); \ fi && \ curl -o \ /tmp/plexmediaserver.deb -L \ - "https://downloads.plex.tv/plex-media-server/${PLEX_RELEASE}/plexmediaserver_${PLEX_RELEASE}_amd64.deb" && \ + "${PLEX_DOWNLOAD}/${PLEX_RELEASE}/debian/plexmediaserver_${PLEX_RELEASE}_${PLEX_ARCH}.deb" && \ dpkg -i /tmp/plexmediaserver.deb && \ mv /sbin/udevadm.bak /sbin/udevadm && \ echo "**** ensure abc user's home folder is /app ****" && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 3aa48c8..961d8e1 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -12,6 +12,8 @@ LABEL maintainer="sparklyballs, thelamer" # global environment settings ENV DEBIAN_FRONTEND="noninteractive" \ +PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server-new" \ +PLEX_ARCH="arm64" \ PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/config/Library/Application Support" \ PLEX_MEDIA_SERVER_HOME="/usr/lib/plexmediaserver" \ PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS="6" \ @@ -32,9 +34,13 @@ RUN \ echo "exit 0" > /sbin/udevadm && \ chmod +x /sbin/udevadm && \ echo "**** install plex ****" && \ + if [ -z ${PLEX_RELEASE+x} ]; then \ + PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \ + | jq -r '.computer.Linux.version'); \ + fi && \ curl -o \ /tmp/plexmediaserver.deb -L \ - "https://downloads.plex.tv/plex-media-server-new/1.15.0.647-67e950f12/debian/plexmediaserver_1.15.0.647-67e950f12_arm64.deb" && \ + "${PLEX_DOWNLOAD}/${PLEX_RELEASE}/debian/plexmediaserver_${PLEX_RELEASE}_${PLEX_ARCH}.deb" && \ dpkg -i /tmp/plexmediaserver.deb && \ mv /sbin/udevadm.bak /sbin/udevadm && \ echo "**** ensure abc user's home folder is /app ****" && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 1e2a6dc..0e8036d 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -12,6 +12,8 @@ LABEL maintainer="sparklyballs, thelamer" # global environment settings ENV DEBIAN_FRONTEND="noninteractive" \ +PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server-new" \ +PLEX_ARCH="armhf" \ PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/config/Library/Application Support" \ PLEX_MEDIA_SERVER_HOME="/usr/lib/plexmediaserver" \ PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS="6" \ @@ -32,9 +34,13 @@ RUN \ echo "exit 0" > /sbin/udevadm && \ chmod +x /sbin/udevadm && \ echo "**** install plex ****" && \ + if [ -z ${PLEX_RELEASE+x} ]; then \ + PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \ + | jq -r '.computer.Linux.version'); \ + fi && \ curl -o \ /tmp/plexmediaserver.deb -L \ - "https://downloads.plex.tv/plex-media-server-new/1.15.0.647-67e950f12/debian/plexmediaserver_1.15.0.647-67e950f12_armhf.deb" && \ + "${PLEX_DOWNLOAD}/${PLEX_RELEASE}/debian/plexmediaserver_${PLEX_RELEASE}_${PLEX_ARCH}.deb" && \ dpkg -i /tmp/plexmediaserver.deb && \ mv /sbin/udevadm.bak /sbin/udevadm && \ echo "**** ensure abc user's home folder is /app ****" && \ diff --git a/Jenkinsfile b/Jenkinsfile index bc549d7..239aa2f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,6 +10,8 @@ pipeline { environment { BUILDS_DISCORD=credentials('build_webhook_url') 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' LS_USER = 'linuxserver' LS_REPO = 'docker-plex' @@ -26,7 +28,7 @@ pipeline { CI_DELAY='120' CI_DOCKERENV='TZ=US/Pacific' CI_AUTH='user:password' - CI_WEBPATH='/web' + CI_WEBPATH='' } stages { // Setup all the basic environment variables needed for the build @@ -91,16 +93,16 @@ pipeline { /* ######################## External Release Tagging ######################## */ - // If this is a custom command to determine version use that command - stage("Set tag custom bash"){ - steps{ - script{ - 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 ''', - returnStdout: true).trim() - env.RELEASE_LINK = 'custom_command' - } - } + // If this is a custom json endpoint parse the return to get external tag + stage("Set ENV custom_json"){ + steps{ + script{ + env.EXT_RELEASE = sh( + script: '''curl -s ${JSON_URL} | jq -r ". | ${JSON_PATH}" ''', + returnStdout: true).trim() + env.RELEASE_LINK = env.JSON_URL + } + } } // Sanitize the release tag and strip illegal docker or github characters stage("Sanitize tag"){ @@ -558,7 +560,7 @@ pipeline { "tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' echo "Pushing New release for Tag" 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}'",\ "target_commitish": "master",\ "name": "'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\ diff --git a/README.md b/README.md index 014fb3b..689c332 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ Find us at: [![](https://lsio-ci.ams3.digitaloceanspaces.com/linuxserver/plex/latest/badge.svg)](https://lsio-ci.ams3.digitaloceanspaces.com/linuxserver/plex/latest/index.html) [Plex](https://plex.tv) organizes video, music and photos from personal media libraries and streams them to smart TVs, streaming boxes and mobile devices. This container is packaged as a standalone Plex Media Server. has always been a top priority. Straightforward design and bulk actions mean getting things done faster. -*To All Arm Users* - Plex is currently transitioning to a new build system allowing everyone to ingest software releases for all popular architectures. In the mean time releases on this channel for armv7 and aarch64 will be frozen at a beta release version of 1.15, including plex pass users. For armv7 users that want a stable release please use our legacy repo [Here](https://hub.docker.com/r/lsioarmhf/plex) . [![plex](http://the-gadgeteer.com/wp-content/uploads/2015/10/plex-logo-e1446990678679.png)](https://plex.tv) @@ -212,6 +211,7 @@ Below are the instructions for updating containers: ## Versions +* **14.03.19:** - Switch to new api endpoints, enable beta (plex pass) updates for armhf and aarch64. * **15.02.19:** - Clean up plex pid after unclean stop. * **11.02.19:** - Fix nvidia variables, add device variables. * **16.01.19:** - Add pipeline logic, multi arch, and HW transcoding configuration; remove avahi service. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 4be41fa..96f293d 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -2,12 +2,13 @@ # jenkins variables project_name: docker-plex -external_type: na -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 +external_type: custom_json release_type: stable release_tag: latest ls_branch: master repo_vars: + - JSON_URL = 'https://plex.tv/api/downloads/5.json' + - JSON_PATH = '.computer.Linux.version' - BUILD_VERSION_ARG = 'PLEX_RELEASE' - LS_USER = 'linuxserver' - LS_REPO = 'docker-plex' @@ -24,4 +25,4 @@ repo_vars: - CI_DELAY='120' - CI_DOCKERENV='TZ=US/Pacific' - CI_AUTH='user:password' - - CI_WEBPATH='/web' + - CI_WEBPATH='' diff --git a/readme-vars.yml b/readme-vars.yml index 0326efb..c59a09c 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -4,9 +4,8 @@ project_name: plex project_url: "https://plex.tv" project_logo: "http://the-gadgeteer.com/wp-content/uploads/2015/10/plex-logo-e1446990678679.png" -project_blurb: "[{{ project_name|capitalize }}]({{ project_url }}) organizes video, music and photos from personal media libraries and streams them to smart TVs, streaming boxes and mobile devices. This container is packaged as a standalone Plex Media Server. has always been a top priority. Straightforward design and bulk actions mean getting things done faster. +project_blurb: "[{{ project_name|capitalize }}]({{ project_url }}) organizes video, music and photos from personal media libraries and streams them to smart TVs, streaming boxes and mobile devices. This container is packaged as a standalone Plex Media Server. has always been a top priority. Straightforward design and bulk actions mean getting things done faster." - *To All Arm Users* - Plex is currently transitioning to a new build system allowing everyone to ingest software releases for all popular architectures. In the mean time releases on this channel for armv7 and aarch64 will be frozen at a beta release version of 1.15, including plex pass users. For armv7 users that want a stable release please use our legacy repo [Here](https://hub.docker.com/r/lsioarmhf/plex) ." project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}" # supported architectures @@ -83,6 +82,7 @@ app_setup_block: | # changelog changelogs: + - { date: "14.03.19:", desc: "Switch to new api endpoints, enable beta (plex pass) updates for armhf and aarch64." } - { date: "15.02.19:", desc: "Clean up plex pid after unclean stop." } - { date: "11.02.19:", desc: "Fix nvidia variables, add device variables." } - { date: "16.01.19:", desc: "Add pipeline logic, multi arch, and HW transcoding configuration; remove avahi service." } diff --git a/root/etc/cont-init.d/60-plex-update b/root/etc/cont-init.d/60-plex-update index de8baf5..2c942d3 100755 --- a/root/etc/cont-init.d/60-plex-update +++ b/root/etc/cont-init.d/60-plex-update @@ -1,15 +1,5 @@ #!/usr/bin/with-contenv bash -# determine architecture to gaurd arm variants in deployment stage 1 -ARCH=$(arch) -if [[ "${ARCH}" == armv* ]]; then - echo "This is armv7, upgrading Plex is not supported yet" - exit 0 -elif [[ "${ARCH}" == "aarch64" ]]; then - echo "This is aarch64, upgrading Plex is not supported yet" - exit 0 -fi - # If docker manages versioning exit if [ "${VERSION}" ] && [ "${VERSION}" == 'docker' ]; then echo "Docker is used for verisoning skip update check" @@ -22,7 +12,7 @@ if (dpkg --get-selections plexmediaserver | grep -wq "install"); then else echo "for some reason plex doesn't appear to be installed, pulling a new copy and exiting out of update script" curl -o /tmp/plexmediaserver.deb -L \ - "${PLEX_INSTALL}" && \ + "${PLEX_DOWNLOAD}/${REMOTE_VERSION}/debian/plexmediaserver_${REMOTE_VERSION}_${PLEX_ARCH}.deb" && \ dpkg -i --force-confold /tmp/plexmediaserver.deb rm -f /tmp/plexmediaserver.deb exit 0 @@ -101,10 +91,16 @@ INSTALLED_VERSION=$(dpkg-query -W -f='${Version}' plexmediaserver) # start update routine if [[ "${VERSION,,}" = latest ]] || [[ "${VERSION,,}" = plexpass ]] || [[ "$PLEXPASS" == "1" ]]; then -REMOTE_VERSION=$(curl -s "${PLEX_INSTALL}&X-Plex-Token=$PLEX_TOKEN"| cut -d "/" -f 5 ) + if [[ "${PLEX_ARCH}" = amd64 ]]; then + PLEX_URL_ARCH="x86_64" + elif [[ "${PLEX_ARCH}" = armhf ]]; then + PLEX_URL_ARCH="armv7hf_neon" + elif [[ "${PLEX_ARCH}" = arm64 ]]; then + PLEX_URL_ARCH="aarch64" + 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 ) elif [[ "${VERSION,,}" = public ]]; then -PLEX_TOKEN="" -REMOTE_VERSION=$(curl -s "${PLEX_INSTALL}&X-Plex-Token=$PLEX_TOKEN"| cut -d "/" -f 5 ) +REMOTE_VERSION=curl -sX GET 'https://plex.tv/api/downloads/5.json' | jq -r '.computer.Linux.version' else REMOTE_VERSION="${VERSION}" fi @@ -116,21 +112,16 @@ fi echo "Atempting to upgrade to: $REMOTE_VERSION" rm -f /tmp/plexmediaserver_*.deb -if [[ $REMOTE_VERSION == 1.15* ]]; then wget -nv -P /tmp \ -"https://downloads.plex.tv/plex-media-server-new/$REMOTE_VERSION/debian/plexmediaserver_${REMOTE_VERSION}_amd64.deb" -else -wget -nv -P /tmp \ -"${PLEX_DOWNLOAD}/$REMOTE_VERSION/plexmediaserver_${REMOTE_VERSION}_amd64.deb" -fi +"${PLEX_DOWNLOAD}/${REMOTE_VERSION}/debian/plexmediaserver_${REMOTE_VERSION}_${PLEX_ARCH}.deb" last=$? # test if deb file size is ok, or if download failed -if [[ "$last" -gt "0" ]] || [[ $(stat -c %s /tmp/plexmediaserver_"${REMOTE_VERSION}"_amd64.deb) -lt 10000 ]]; then +if [[ "$last" -gt "0" ]] || [[ $(stat -c %s /tmp/plexmediaserver_"${REMOTE_VERSION}"_${PLEX_ARCH}.deb) -lt 10000 ]]; then printf '\n\n\n%s\n\n\n' "$(