Skip to content

Commit

Permalink
Changed latest->plexpass to allow latest to be tagged to a version.
Browse files Browse the repository at this point in the history
Also the updater always behaves how the image was tagged at build.
  • Loading branch information
gbooker committed Dec 12, 2016
1 parent 05e1a5b commit b2c4f81
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/ /

Expand Down
15 changes: 8 additions & 7 deletions root/etc/cont-init.d/50-plex-update
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions root/installBinary.sh
Original file line number Diff line number Diff line change
@@ -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')
Expand Down

0 comments on commit b2c4f81

Please sign in to comment.