mirror of
https://gh.con.sh/https://github.com/plexinc/pms-docker
synced 2025-05-18 14:51:12 +00:00
Changed latest
->plexpass
to allow latest to be tagged to a version.
Also the updater always behaves how the image was tagged at build.
This commit is contained in:
parent
05e1a5b1e9
commit
b2c4f8109a
@ -41,12 +41,11 @@ RUN \
|
||||
EXPOSE 32400/tcp 3005/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414/udp
|
||||
VOLUME /config /transcode
|
||||
|
||||
ENV VERSION=latest \
|
||||
CHANGE_DIR_RIGHTS="false" \
|
||||
ENV CHANGE_DIR_RIGHTS="false" \
|
||||
CHANGE_CONFIG_DIR_OWNERSHIP="true" \
|
||||
HOME="/config"
|
||||
|
||||
ARG TAG=latest
|
||||
ARG TAG=plexpass
|
||||
|
||||
COPY root/ /
|
||||
|
||||
|
@ -25,23 +25,24 @@ else
|
||||
fi
|
||||
|
||||
# Read set version
|
||||
if [ -e /version.txt ]; then
|
||||
VERSION="$(cat /version.txt)"
|
||||
echo "Setting version to ${VERSION} per container configuration"
|
||||
versionToInstall="$(cat /version.txt)"
|
||||
if [ -z "${versionToInstall}" ]; then
|
||||
echo "No version specified in install. Broken image"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Short-circuit test of version before remote check to see if it's already installed.
|
||||
if [ "${VERSION}" = "${installedVersion}" ]; then
|
||||
if [ "${versionToInstall}" = "${installedVersion}" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Get updated version number
|
||||
if [ "${VERSION,,}" = "latest" ]; then
|
||||
if [ "${versionToInstall,,}" = "plexpass" ]; then
|
||||
versionInfo="$(curl -s "https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&channel=8&distro=ubuntu&X-Plex-Token=${token}")"
|
||||
elif [ "${VERSION,,}" = "public" ]; then
|
||||
elif [ "${versionToInstall,,}" = "public" ]; then
|
||||
versionInfo="$(curl -s "https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&channel=16&distro=ubuntu")"
|
||||
else
|
||||
versionInfo="$(curl -s "https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&channel=8&distro=ubuntu&X-Plex-Token=${token}&version=${VERSION}")"
|
||||
versionInfo="$(curl -s "https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&channel=8&distro=ubuntu&X-Plex-Token=${token}&version=${versionToInstall}")"
|
||||
fi
|
||||
|
||||
if [ -z "${versionInfo}" ]; then
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "${TAG}" != "latest" ] && [ "${TAG}" != "public" ]; then
|
||||
echo "${TAG}" > /version.txt
|
||||
echo "${TAG}" > /version.txt
|
||||
if [ "${TAG}" != "plexpass" ] && [ "${TAG}" != "public" ]; then
|
||||
versionInfo="$(curl -s "https://plex.tv/downloads/details/1?build=linux-ubuntu-x86_64&channel=8&distro=ubuntu&X-Plex-Token=${token}&version=${TAG}")"
|
||||
remoteVersion=$(echo "${versionInfo}" | sed -n 's/.*Release.*version="\([^"]*\)".*/\1/p')
|
||||
remoteFile=$(echo "${versionInfo}" | sed -n 's/.*file="\([^"]*\)".*/\1/p')
|
||||
|
Loading…
x
Reference in New Issue
Block a user