Pipeline hw (#150)

* adding multi arch logic and pipeline, first version of included hardware accel info, pulling debs from new endpoint

* removing web screenshotting from ci process

* adding update logic for arm variants and templating readme file

* Adding nvidia environment variables

* Adding information on nvidia container runtime

* updating pipeline logic to use static endpoint and disabling updates on those branches

* bug bashing escape characters in jenkins logic

* remove avahi service that is no longer needed by plex

* set new artifact download location
This commit is contained in:
Ryan Kuba 2019-02-06 12:16:30 -08:00 committed by chbmb
parent 391f0a773c
commit 88765a032a
12 changed files with 1069 additions and 120 deletions

View file

@ -1,15 +0,0 @@
#!/usr/bin/with-contenv bash
# make folders
mkdir -p \
/var/run/dbus
# delete existing pid if found
[[ -e /var/run/dbus/pid ]] && \
rm -f /var/run/dbus/pid
# permissions
chown messagebus:messagebus \
/var/run/dbus
dbus-uuidgen --ensure
sleep 1

View file

@ -0,0 +1,25 @@
#!/usr/bin/with-contenv bash
# Check for the existence of the Intel video device
if [ -e /dev/dri ]; then
VIDEO_GID=$(stat -c '%g' /dev/dri/* | head -n 1)
else
exit 0
fi
# Check if this GID matches the current abc user
ABCGID=$(getent group abc | awk -F: '{print $3}')
if [ "${ABCGID}" == "${VIDEO_GID}" ]; then
exit 0
fi
# Check if the GID is taken and swap to 65533
CURRENT=$(getent group ${VIDEO_GID} | awk -F: '{print $1}')
if [ -z "${CURRENT}" ] || [ "${CURRENT}" == 'video' ]; then
groupmod -g ${VIDEO_GID} video
usermod -a -G video abc
else
groupmod -g 65533 ${CURRENT}
groupmod -g ${VIDEO_GID} video
usermod -a -G video abc
fi

View file

@ -1,6 +1,16 @@
#!/usr/bin/with-contenv bash
# test if plex is installed and try re-pulling latest if not
# 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
# test if plex is installed and try re-pulling latest if not
if (dpkg --get-selections plexmediaserver | grep -wq "install"); then
:
else
@ -12,30 +22,30 @@ rm -f /tmp/plexmediaserver.deb
exit 0
fi
# set no update message
# set no update message
[[ -e /tmp/no-version.nfo ]] && \
rm /tmp/no-version.nfo
NOVERSION_SET='/tmp/no-version.nfo'
cat > "${NOVERSION_SET}" <<-EOFVERSION
#######################################################
# Update routine will not run because you havent set #
# Update routine will not run because you havent set #
# the VERSION variable or you opted out of updates. #
# For more information checkout :- #
#  https://github.com/linuxserver/docker-plex #
# https://github.com/linuxserver/docker-plex #
#######################################################
EOFVERSION
# set update failed message
# set update failed message
[[ -e /tmp/update_fail.nfo ]] && \
rm /tmp/update_fail.nfo
UPGRADE_FAIL='/tmp/update_fail.nfo'
cat > "${UPGRADE_FAIL}" <<-EOFFAIL
########################################################
# Upgrade attempt failed, this could be because either #
# Upgrade attempt failed, this could be because either #
# plex update site is down, local network issues, or #
# you were trying to get a version that simply doesn't #
# exist, check over the VERSION variable thoroughly & #
# correct it or try again later. #
# exist, check over the VERSION variable thoroughly & #
# correct it or try again later. #
########################################################
EOFFAIL
@ -45,7 +55,7 @@ printf '\n\n\n%s\n\n\n' "$(</tmp/no-version.nfo)"
exit 0
fi
# set header for no preferences/token message
# set header for no preferences/token message
[[ -e /tmp/no-token.nfo ]] && \
rm /tmp/no-token.nfo
NOTOKEN_SET='/tmp/no-token.nfo'
@ -55,7 +65,7 @@ cat > "${NOTOKEN_SET}" <<-EOFTOKEN
# and restart the docker, because there was no #
EOFTOKEN
# if preferences files doesn't exist, exit out
# if preferences files doesn't exist, exit out
if [ ! -e "/config/Library/Application Support/Plex Media Server/Preferences.xml" ]; then
cat >> "${NOTOKEN_SET}" <<-EOFTOKEN
# preference file found, possibly first startup. #
@ -100,15 +110,20 @@ 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
last=$?
# test if deb file size is ok, or if download failed
# 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
printf '\n\n\n%s\n\n\n' "$(</tmp/update_fail.nfo)"
exit 0
# if ok, try to install it.
# if ok, try to install it.
else
dpkg -i --force-confold /tmp/plexmediaserver_"${REMOTE_VERSION}"_amd64.deb
rm -f /tmp/plexmediaserver_*.deb