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:
Graham Booker 2016-12-12 10:41:27 -06:00
parent 05e1a5b1e9
commit b2c4f8109a
3 changed files with 12 additions and 12 deletions

View File

@ -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/ /

View File

@ -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

View File

@ -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')