From f5373d8b8bac03dd845cd631d75306036c0509e4 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Mon, 18 Dec 2023 09:19:11 +0000 Subject: [PATCH 01/22] Bot Updating Package Versions --- package_versions.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package_versions.txt b/package_versions.txt index f71be0a..65c2163 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -10,7 +10,7 @@ bsdutils 1:2.37.2-4ubuntu3 deb ca-certificates 20230311ubuntu0.22.04.1 deb coreutils 8.32-4.1ubuntu1 deb cron 3.0pl1-137ubuntu3 deb -curl 7.81.0-1ubuntu1.14 deb +curl 7.81.0-1ubuntu1.15 deb dash 0.5.11+git20210903+057cd650a4ed-3build1 deb debconf 1.5.79ubuntu1 deb debianutils 5.5-1ubuntu2 deb @@ -51,7 +51,7 @@ libcap-ng0 0.7.9-2.2build3 deb libcap2 1:2.44-1ubuntu0.22.04.1 deb libcom-err2 1.46.5-2ubuntu1.1 deb libcrypt1 1:4.4.27-1 deb -libcurl4 7.81.0-1ubuntu1.14 deb +libcurl4 7.81.0-1ubuntu1.15 deb libdb5.3 5.3.28+dfsg1-0.8ubuntu3 deb libdebconfclient0 0.261ubuntu1 deb libext2fs2 1.46.5-2ubuntu1.1 deb @@ -119,7 +119,7 @@ libunistring2 1.0-1 deb libuuid1 2.37.2-4ubuntu3 deb libxxhash0 0.8.1-1 deb libzstd1 1.4.8+dfsg-3build1 deb -locales 2.35-0ubuntu3.4 deb +locales 2.35-0ubuntu3.5 deb login 1:4.8.1-2ubuntu2.1 deb logsave 1.46.5-2ubuntu1.1 deb lsb-base 11.1.0ubuntu4 deb @@ -139,7 +139,7 @@ publicsuffix 20211207.1025-1 deb readline-common 8.1.2-1 deb sed 4.8-1ubuntu2 deb sensible-utils 0.0.17 deb -systemd-hwe-hwdb 249.11.3 deb +systemd-hwe-hwdb 249.11.4 deb sysvinit-utils 3.01-1ubuntu1 deb tar 1.34+dfsg-1ubuntu0.1.22.04.1 deb tzdata 2023c-0ubuntu0.22.04.2 deb From d5e04e319311c2e81bfcae6ad2feefa7c97ad603 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Mon, 25 Dec 2023 09:18:00 +0000 Subject: [PATCH 02/22] Bot Updating Package Versions --- package_versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_versions.txt b/package_versions.txt index 65c2163..608d418 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -106,7 +106,7 @@ libsepol2 3.3-1build1 deb libsmartcols1 2.37.2-4ubuntu3 deb libsqlite3-0 3.37.2-2ubuntu0.1 deb libss2 1.46.5-2ubuntu1.1 deb -libssh-4 0.9.6-2ubuntu0.22.04.1 deb +libssh-4 0.9.6-2ubuntu0.22.04.2 deb libssl3 3.0.2-0ubuntu1.10 deb libstdc++6 12.1.0-2ubuntu1~22.04 deb libsystemd0 249.11-0ubuntu3.9 deb From b046c3ffb44ecda558b49496ebc211cbc5e6957a Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 8 Jan 2024 20:02:48 -0600 Subject: [PATCH 03/22] Replace existing chown with lsiown Signed-off-by: Eric Nemchik --- root/etc/s6-overlay/s6-rc.d/init-plex-chown/run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run index b64fe98..3496fb4 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run @@ -3,7 +3,7 @@ # create folders if [ ! -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" ]; then \ mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" - chown -R abc:abc /config + lsiown -R abc:abc /config fi # check Library permissions @@ -11,7 +11,7 @@ PUID=${PUID:-911} if [ ! "$(stat -c %u /config/Library)" = "$PUID" ]; then echo "Change in ownership detected, please be patient while we chown existing files" echo "This could take some time" - chown abc:abc -R \ + lsiown abc:abc -R \ /config/Library fi @@ -21,6 +21,6 @@ if [[ -f "/config/Library/Application Support/Plex Media Server/plexmediaserver. fi # permissions (non-recursive) on config root and folders -chown abc:abc \ +lsiown abc:abc \ /config \ /config/* From b9fdee8cb86e69c7211b73840b8ad8053b4712c3 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 8 Jan 2024 20:22:56 -0600 Subject: [PATCH 04/22] set permissions on Plex Transcoder Temp Directory Signed-off-by: Eric Nemchik --- root/etc/s6-overlay/s6-rc.d/init-plex-chown/run | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run index 3496fb4..1a50eab 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run @@ -20,6 +20,18 @@ if [[ -f "/config/Library/Application Support/Plex Media Server/plexmediaserver. rm -f "/config/Library/Application Support/Plex Media Server/plexmediaserver.pid" fi +# set permissions on Plex Transcoder Temp Directory +PREFNAME="/config/Library/Application Support/Plex Media Server/Preferences.xml" +if [[ -f "${PREFNAME}" ]]; then + TranscoderTempDirectory='\bTranscoderTempDirectory="([^"]+)"' + while IFS= read -r line; do + if [[ ${line} =~ ${TranscoderTempDirectory} ]] && [[ -d "${BASH_REMATCH[1]}" ]]; then + echo "Setting permissions on ${BASH_REMATCH[1]}" + lsiown -R abc:abc "${BASH_REMATCH[1]}" + fi + done <"${PREFNAME}" +fi + # permissions (non-recursive) on config root and folders lsiown abc:abc \ /config \ From 4b79b7759e22eea31d4041386517037a2a21ca8e Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 8 Jan 2024 21:07:50 -0600 Subject: [PATCH 05/22] Remove unused file Signed-off-by: Eric Nemchik --- root/defaults/plexmediaserver | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 root/defaults/plexmediaserver diff --git a/root/defaults/plexmediaserver b/root/defaults/plexmediaserver deleted file mode 100644 index 071c896..0000000 --- a/root/defaults/plexmediaserver +++ /dev/null @@ -1,16 +0,0 @@ -# default script for Plex Media Server - -# the number of plugins that can run at the same time -PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6 - -# ulimit -s $PLEX_MEDIA_SERVER_MAX_STACK_SIZE -PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000 - -# uncomment to set it to something else -PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/config/Library/Application Support" - -# the user that PMS should run as, defaults to 'plex' -# note that if you change this you might need to move -# the Application Support directory to not lose your -# media library -PLEX_MEDIA_SERVER_USER=abc From 56562f49564b5b6b1a4e251c8790b38d80771a25 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 8 Jan 2024 21:17:32 -0600 Subject: [PATCH 06/22] Fix various shellcheck concerns Signed-off-by: Eric Nemchik --- .../s6-overlay/s6-rc.d/init-plex-chown/run | 13 ++-- .../s6-overlay/s6-rc.d/init-plex-claim/run | 58 ++++++++++-------- .../s6-rc.d/init-plex-gid-video/run | 10 +-- .../s6-overlay/s6-rc.d/init-plex-update/run | 61 ++++++++++--------- root/etc/s6-overlay/s6-rc.d/svc-plex/run | 9 ++- 5 files changed, 83 insertions(+), 68 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run index 1a50eab..e7863da 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run @@ -1,18 +1,19 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash # create folders -if [ ! -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" ]; then \ +if [[ ! -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" ]]; then mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" lsiown -R abc:abc /config fi # check Library permissions PUID=${PUID:-911} -if [ ! "$(stat -c %u /config/Library)" = "$PUID" ]; then +if [[ ! "$(stat -c %u /config/Library)" == "${PUID}" ]]; then echo "Change in ownership detected, please be patient while we chown existing files" echo "This could take some time" lsiown abc:abc -R \ - /config/Library + /config/Library fi # remove plex pid after unclean stop @@ -21,15 +22,15 @@ if [[ -f "/config/Library/Application Support/Plex Media Server/plexmediaserver. fi # set permissions on Plex Transcoder Temp Directory -PREFNAME="/config/Library/Application Support/Plex Media Server/Preferences.xml" -if [[ -f "${PREFNAME}" ]]; then +PLEX_MEDIA_SERVER_PREFERENCES="${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}/Plex Media Server/Preferences.xml" +if [[ -f "${PLEX_MEDIA_SERVER_PREFERENCES}" ]]; then TranscoderTempDirectory='\bTranscoderTempDirectory="([^"]+)"' while IFS= read -r line; do if [[ ${line} =~ ${TranscoderTempDirectory} ]] && [[ -d "${BASH_REMATCH[1]}" ]]; then echo "Setting permissions on ${BASH_REMATCH[1]}" lsiown -R abc:abc "${BASH_REMATCH[1]}" fi - done <"${PREFNAME}" + done <"${PLEX_MEDIA_SERVER_PREFERENCES}" fi # permissions (non-recursive) on config root and folders diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-claim/run b/root/etc/s6-overlay/s6-rc.d/init-plex-claim/run index c597876..a94451e 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-plex-claim/run +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-claim/run @@ -1,83 +1,89 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash -if grep -qs "PlexOnlineToken" "/config/Library/Application Support/Plex Media Server/Preferences.xml"; then +PLEX_MEDIA_SERVER_PREFERENCES="${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}/Plex Media Server/Preferences.xml" + +if grep -qs "PlexOnlineToken" "${PLEX_MEDIA_SERVER_PREFERENCES}"; then echo "**** Server already claimed ****" exit 0 -elif [ -z "$PLEX_CLAIM" ]; then +elif [[ -z "$PLEX_CLAIM" ]]; then echo "**** Server is unclaimed, but no claim token has been set ****" exit 0 fi -PREFNAME="/config/Library/Application Support/Plex Media Server/Preferences.xml" -if [ ! -f "${PREFNAME}" ]; then + +if [[ ! -f "${PLEX_MEDIA_SERVER_PREFERENCES}" ]]; then UMASK_SET="${UMASK_SET:-022}" umask "$UMASK_SET" echo "Temporarily starting Plex Media Server." - export PLEX_MEDIA_SERVER_INFO_MODEL=$(uname -m) - export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION=$(uname -r) + PLEX_MEDIA_SERVER_INFO_MODEL=$(uname -m) + export PLEX_MEDIA_SERVER_INFO_MODEL + PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION=$(uname -r) + export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION s6-setuidgid abc /bin/bash -c \ - 'LD_LIBRARY_PATH=/usr/lib/plexmediaserver:/usr/lib/plexmediaserver/lib /usr/lib/plexmediaserver/Plex\ Media\ Server' & PID=$! + 'LD_LIBRARY_PATH=/usr/lib/plexmediaserver:/usr/lib/plexmediaserver/lib /usr/lib/plexmediaserver/Plex\ Media\ Server' & + PID=$! echo "Waiting for Plex to generate its config" DBNAME="/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal" - until [ -f "${DBNAME}" ]; do + until [[ -f "${DBNAME}" ]]; do sleep 1 done while true; do echo "Waiting for database creation to complete..." - if [ -z "${COMPARE_MD5+x}" ]; then - COMPARE_MD5=$(md5sum "${DBNAME}"| cut -c1-8) + if [[ -z "${COMPARE_MD5+x}" ]]; then + COMPARE_MD5=$(md5sum "${DBNAME}" | cut -c1-8) sleep 3 else sleep 3 - CURRENT_MD5=$(md5sum "${DBNAME}"| cut -c1-8) - if [ "${CURRENT_MD5}" == "${COMPARE_MD5}" ]; then + CURRENT_MD5=$(md5sum "${DBNAME}" | cut -c1-8) + if [[ "${CURRENT_MD5}" == "${COMPARE_MD5}" ]]; then break else - COMPARE_MD5=$(md5sum "${DBNAME}"| cut -c1-8) + COMPARE_MD5=$(md5sum "${DBNAME}" | cut -c1-8) fi fi done - until grep -qs "ProcessedMachineIdentifier" "${PREFNAME}"; do + until grep -qs "ProcessedMachineIdentifier" "${PLEX_MEDIA_SERVER_PREFERENCES}"; do sleep 1 done while true; do echo "Waiting for pref file creation to complete..." - if [ -z "${PREF_COMPARE_MD5+x}" ]; then - PREF_COMPARE_MD5=$(md5sum "${PREFNAME}"| cut -c1-8) + if [[ -z "${PREF_COMPARE_MD5+x}" ]]; then + PREF_COMPARE_MD5=$(md5sum "${PLEX_MEDIA_SERVER_PREFERENCES}" | cut -c1-8) sleep 3 else sleep 3 - PREF_CURRENT_MD5=$(md5sum "${PREFNAME}"| cut -c1-8) - if [ "${PREF_CURRENT_MD5}" == "${PREF_COMPARE_MD5}" ]; then + PREF_CURRENT_MD5=$(md5sum "${PLEX_MEDIA_SERVER_PREFERENCES}" | cut -c1-8) + if [[ "${PREF_CURRENT_MD5}" == "${PREF_COMPARE_MD5}" ]]; then break else - PREF_COMPARE_MD5=$(md5sum "${PREFNAME}"| cut -c1-8) + PREF_COMPARE_MD5=$(md5sum "${PLEX_MEDIA_SERVER_PREFERENCES}" | cut -c1-8) fi fi done echo "Stopping Plex to claim server" - while ps -p $PID > /dev/null; do + while ps -p $PID >/dev/null; do kill $PID sleep 1 done echo "Plex stopped" fi -ProcessedMachineIdentifier=$(sed -n "s/^.*ProcessedMachineIdentifier=\"\([^\"]*\)\".*$/\1/p" "${PREFNAME}") +ProcessedMachineIdentifier=$(sed -n "s/^.*ProcessedMachineIdentifier=\"\([^\"]*\)\".*$/\1/p" "${PLEX_MEDIA_SERVER_PREFERENCES}") PlexOnlineToken="$(curl -X POST \ -H 'X-Plex-Client-Identifier: '"${ProcessedMachineIdentifier}" \ - -H 'X-Plex-Product: Plex Media Server'\ + -H 'X-Plex-Product: Plex Media Server' \ -H 'X-Plex-Version: 1.1' \ -H 'X-Plex-Provides: server' \ -H 'X-Plex-Platform: Linux' \ -H 'X-Plex-Platform-Version: 1.0' \ -H 'X-Plex-Device-Name: PlexMediaServer' \ -H 'X-Plex-Device: Linux' \ - "https://plex.tv/api/claim/exchange?token=${PLEX_CLAIM}" \ - | sed -n 's/.*\(.*\)<\/authentication-token>.*/\1/p')" + "https://plex.tv/api/claim/exchange?token=${PLEX_CLAIM}" | + sed -n 's/.*\(.*\)<\/authentication-token>.*/\1/p')" -if [ -n "$PlexOnlineToken" ]; then +if [[ -n "$PlexOnlineToken" ]]; then echo "Server claimed successfully, navigate to http://serverip:32400/web to complete plex setup." - sed -i "s/\/>/ PlexOnlineToken=\"${PlexOnlineToken}\"\/>/g" "${PREFNAME}" + sed -i "s/\/>/ PlexOnlineToken=\"${PlexOnlineToken}\"\/>/g" "${PLEX_MEDIA_SERVER_PREFERENCES}" else echo "Unable to claim Plex server. Either manually claim by connecting to http://serverip:32400/web from the same network subnet, or recreate container with a new claim token." fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/run b/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/run index c07fe60..cd01d81 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/run +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/run @@ -1,9 +1,9 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash FILES=$(find /dev/dri /dev/dvb -type c -print 2>/dev/null) -for i in $FILES -do +for i in ${FILES}; do VIDEO_GID=$(stat -c '%g' "${i}") VIDEO_UID=$(stat -c '%u' "${i}") # check if user matches device @@ -11,13 +11,13 @@ do echo "**** permissions for ${i} are good ****" else # check if group matches and that device has group rw - if id -G abc | grep -qw "${VIDEO_GID}" && [ $(stat -c '%A' "${i}" | cut -b 5,6) = "rw" ]; then + if id -G abc | grep -qw "${VIDEO_GID}" && [[ $(stat -c '%A' "${i}" | cut -b 5,6) == "rw" ]]; then echo "**** permissions for ${i} are good ****" # check if device needs to be added to video group elif ! id -G abc | grep -qw "${VIDEO_GID}"; then # check if video group needs to be created VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}') - if [ -z "${VIDEO_NAME}" ]; then + if [[ -z "${VIDEO_NAME}" ]]; then VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-z0-9' | head -c4)" groupadd "${VIDEO_NAME}" groupmod -g "${VIDEO_GID}" "${VIDEO_NAME}" @@ -27,7 +27,7 @@ do usermod -a -G "${VIDEO_NAME}" abc fi # check if device has group rw - if [ $(stat -c '%A' "${i}" | cut -b 5,6) != "rw" ]; then + if [[ $(stat -c '%A' "${i}" | cut -b 5,6) != "rw" ]]; then echo -e "**** The device ${i} does not have group read/write permissions, attempting to fix inside the container. ****" chmod g+rw "${i}" fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-update/run b/root/etc/s6-overlay/s6-rc.d/init-plex-update/run index 6e2b65b..33b9968 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-plex-update/run +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-update/run @@ -1,7 +1,8 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash # If docker manages versioning exit -if [ "${VERSION}" ] && [ "${VERSION}" == 'docker' ]; then +if [[ -n "${VERSION}" ]] && [[ "${VERSION}" == "docker" ]]; then echo "Docker is used for versioning skip update check" exit 0 fi @@ -12,19 +13,20 @@ 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_DOWNLOAD}/${REMOTE_VERSION}/debian/plexmediaserver_${REMOTE_VERSION}_${PLEX_ARCH}.deb" && \ + "${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 fi # set no update message -[[ -e /tmp/no-version.nfo ]] && \ +if [[ -e /tmp/no-version.nfo ]]; then rm /tmp/no-version.nfo +fi NOVERSION_SET='/tmp/no-version.nfo' -cat > "${NOVERSION_SET}" <<-EOFVERSION +cat >"${NOVERSION_SET}" <<-EOFVERSION ####################################################### -# Update routine will not run because you havent set # +# Update routine will not run because you haven't set # # the VERSION variable or you opted out of updates. # # For more information checkout :- # # https://github.com/linuxserver/docker-plex # @@ -32,10 +34,11 @@ cat > "${NOVERSION_SET}" <<-EOFVERSION EOFVERSION # set update failed message -[[ -e /tmp/update_fail.nfo ]] && \ +if [[ -e /tmp/update_fail.nfo ]]; then rm /tmp/update_fail.nfo +fi UPGRADE_FAIL='/tmp/update_fail.nfo' -cat > "${UPGRADE_FAIL}" <<-EOFFAIL +cat >"${UPGRADE_FAIL}" <<-EOFFAIL ######################################################## # Upgrade attempt failed, this could be because either # # plex update site is down, local network issues, or # @@ -45,25 +48,27 @@ cat > "${UPGRADE_FAIL}" <<-EOFFAIL ######################################################## EOFFAIL -# test for no version set or opt out for autoupdates -if [[ -z "$VERSION" ]] || [[ "$VERSION" == "0" ]] || [[ -n "$ADVANCED_DISABLEUPDATES" ]]; then +# test for no version set or opt out for auto updates +if [[ -z "${VERSION}" ]] || [[ "${VERSION}" == "0" ]] || [[ -n "${ADVANCED_DISABLEUPDATES}" ]]; then printf '\n\n\n%s\n\n\n' "$( "${NOTOKEN_SET}" <<-EOFTOKEN +cat >"${NOTOKEN_SET}" <<-EOFTOKEN ##################################################### # Login via the webui at http://:32400/web # # and restart the container, because there was no # EOFTOKEN # if preferences files doesn't exist, exit out -if [ ! -e "/config/Library/Application Support/Plex Media Server/Preferences.xml" ]; then - cat >> "${NOTOKEN_SET}" <<-EOFTOKEN +PLEX_MEDIA_SERVER_PREFERENCES="${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}/Plex Media Server/Preferences.xml" +if [[ ! -e "${PLEX_MEDIA_SERVER_PREFERENCES}" ]]; then + cat >>"${NOTOKEN_SET}" <<-EOFTOKEN # preference file found, possibly first startup. # ##################################################### EOFTOKEN @@ -72,13 +77,13 @@ EOFTOKEN fi # attempt to read plex token -PLEX_TOKEN=$( sed -n 's/.*PlexOnlineToken="//p' \ - "/config/Library/Application Support/Plex Media Server/Preferences.xml" \ - | sed "s/\".*//") +PLEX_TOKEN=$(sed -n 's/.*PlexOnlineToken="//p' \ + "${PLEX_MEDIA_SERVER_PREFERENCES}" | + sed "s/\".*//") # if plex token isn't found, exit out -if [ -z "$PLEX_TOKEN" ]; then - cat >> "${NOTOKEN_SET}" <<-EOFTOKEN +if [[ -z "${PLEX_TOKEN}" ]]; then + cat >>"${NOTOKEN_SET}" <<-EOFTOKEN # plex token found in the preference file # ##################################################### EOFTOKEN @@ -90,22 +95,22 @@ fi INSTALLED_VERSION=$(dpkg-query -W -f='${Version}' plexmediaserver) # start update routine -if [[ "${VERSION,,}" = latest ]] || [[ "${VERSION,,}" = plexpass ]] || [[ "$PLEXPASS" == "1" ]]; then - if [[ "${PLEX_ARCH}" = amd64 ]]; then +if [[ "${VERSION,,}" == "latest" ]] || [[ "${VERSION,,}" == "plexpass" ]] || [[ "${PLEXPASS}" == "1" ]]; then + if [[ "${PLEX_ARCH}" == "amd64" ]]; then PLEX_URL_ARCH="x86_64" - elif [[ "${PLEX_ARCH}" = armhf ]]; then + elif [[ "${PLEX_ARCH}" == "armhf" ]]; then PLEX_URL_ARCH="armv7hf_neon" - elif [[ "${PLEX_ARCH}" = arm64 ]]; then + 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 + 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 REMOTE_VERSION=$(curl -s 'https://plex.tv/api/downloads/5.json' | jq -r '.computer.Linux.version') else REMOTE_VERSION="${VERSION}" fi -if [[ "$REMOTE_VERSION" == "$INSTALLED_VERSION" ]]; then +if [[ "${REMOTE_VERSION}" == "${INSTALLED_VERSION}" ]]; then echo "No update required" exit 0 fi @@ -115,18 +120,18 @@ if [[ -z "${REMOTE_VERSION}" ]]; then exit 0 fi -echo "Atempting to upgrade to: $REMOTE_VERSION" +echo "Attempting to upgrade to: ${REMOTE_VERSION}" rm -f /tmp/plexmediaserver_*.deb wget -nv -P /tmp \ "${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}"_${PLEX_ARCH}.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' "$( Date: Tue, 9 Jan 2024 08:19:08 -0600 Subject: [PATCH 07/22] Update readme-vars.yml Changelog for https://github.com/linuxserver/docker-plex/pull/387 --- readme-vars.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/readme-vars.yml b/readme-vars.yml index 1d11f38..f8a8d87 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -95,6 +95,7 @@ app_setup_block: | We automatically add the necessary environment variable that will utilise all the features available on a GPU on the host. Once nvidia-docker is installed on your host you will need to re/create the docker container with the nvidia container runtime `--runtime=nvidia` and add an environment variable `-e NVIDIA_VISIBLE_DEVICES=all` (can also be set to a specific gpu's UUID, this can be discovered by running `nvidia-smi --query-gpu=gpu_name,gpu_uuid --format=csv` ). NVIDIA automatically mounts the GPU and drivers from your host into the plex docker. # changelog changelogs: + - {date: "09.01.24:", desc: "Set ownership on TranscoderTempDirectory when it's been saved in Preferences."} - {date: "16.08.23:", desc: "Install unrar from [linuxserver repo](https://github.com/linuxserver/docker-unrar)."} - {date: "03.07.23:", desc: "Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)"} - {date: "16.10.22:", desc: "Rebase to jammy. Update to s6v3. Remove opencl packages (bundled with plex)."} From d3542cce1940f614fa35b61a4996a5010c6b44fb Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Sat, 13 Jan 2024 02:02:01 +0000 Subject: [PATCH 08/22] Bot Updating Templated Files --- Jenkinsfile | 295 +++++++++++++++++++++++++++------------------------- 1 file changed, 152 insertions(+), 143 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dee1443..1d41743 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,6 +16,7 @@ pipeline { GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab') GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0') GITLAB_NAMESPACE=credentials('gitlab-namespace-id') + DOCKERHUB_TOKEN=credentials('docker-hub-ci-pat') JSON_URL = 'https://plex.tv/api/downloads/5.json' JSON_PATH = '.computer.Linux.version' BUILD_VERSION_ARG = 'PLEX_RELEASE' @@ -60,11 +61,16 @@ pipeline { env.COMMIT_SHA = sh( script: '''git rev-parse HEAD''', returnStdout: true).trim() + env.GH_DEFAULT_BRANCH = sh( + script: '''git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||' ''', + returnStdout: true).trim() env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/' env.PULL_REQUEST = env.CHANGE_ID env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE .editorconfig ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.yml ./.github/ISSUE_TEMPLATE/issue.feature.yml ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/external_trigger_scheduler.yml ./.github/workflows/greetings.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/call_issue_pr_tracker.yml ./.github/workflows/call_issues_cron.yml ./.github/workflows/permissions.yml ./.github/workflows/external_trigger.yml ./.github/workflows/package_trigger.yml' } + sh '''#! /bin/bash + echo "The default github branch detected as ${GH_DEFAULT_BRANCH}" ''' script{ env.LS_RELEASE_NUMBER = sh( script: '''echo ${LS_RELEASE} |sed 's/^.*-ls//g' ''', @@ -122,7 +128,7 @@ pipeline { steps{ script{ env.EXT_RELEASE_CLEAN = sh( - script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g' ''', + script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:/ ]//g' ''', returnStdout: true).trim() def semver = env.EXT_RELEASE_CLEAN =~ /(\d+)\.(\d+)\.(\d+)/ @@ -140,7 +146,7 @@ pipeline { } if (env.SEMVER != null) { - if (BRANCH_NAME != "master" && BRANCH_NAME != "main") { + if (BRANCH_NAME != "${env.GH_DEFAULT_BRANCH}") { env.SEMVER = "${env.SEMVER}-${BRANCH_NAME}" } println("SEMVER: ${env.SEMVER}") @@ -258,115 +264,150 @@ pipeline { } } steps { - sh '''#! /bin/bash - set -e - TEMPDIR=$(mktemp -d) - docker pull ghcr.io/linuxserver/jenkins-builder:latest - docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest - # Stage 1 - Jenkinsfile update - if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then - mkdir -p ${TEMPDIR}/repo - git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} - cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f master - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/ - git add Jenkinsfile - git commit -m 'Bot Updating Templated Files' - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all - echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} - echo "Updating Jenkinsfile" - rm -Rf ${TEMPDIR} - exit 0 - else - echo "Jenkinsfile is up to date." - fi - # Stage 2 - Delete old templates - OLD_TEMPLATES=".github/ISSUE_TEMPLATE.md .github/ISSUE_TEMPLATE/issue.bug.md .github/ISSUE_TEMPLATE/issue.feature.md .github/workflows/call_invalid_helper.yml .github/workflows/stale.yml Dockerfile.armhf" - for i in ${OLD_TEMPLATES}; do - if [[ -f "${i}" ]]; then - TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}" - fi - done - if [[ -n "${TEMPLATES_TO_DELETE}" ]]; then - mkdir -p ${TEMPDIR}/repo - git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} - cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f master - for i in ${TEMPLATES_TO_DELETE}; do - git rm "${i}" - done - git commit -m 'Bot Updating Templated Files' - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all - echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} - echo "Deleting old and deprecated templates" - rm -Rf ${TEMPDIR} - exit 0 - else - echo "No templates to delete" - fi - # Stage 3 - Update templates - CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) - cd ${TEMPDIR}/docker-${CONTAINER_NAME} - NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) - if [[ "${CURRENTHASH}" != "${NEWHASH}" ]] || ! grep -q '.jenkins-external' "${WORKSPACE}/.gitignore" 2>/dev/null; then - mkdir -p ${TEMPDIR}/repo - git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} - cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f master - cd ${TEMPDIR}/docker-${CONTAINER_NAME} - mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows - mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE - cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || : - cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || : - cd ${TEMPDIR}/repo/${LS_REPO}/ - if ! grep -q '.jenkins-external' .gitignore 2>/dev/null; then - echo ".jenkins-external" >> .gitignore - git add .gitignore - fi - git add readme-vars.yml ${TEMPLATED_FILES} - git commit -m 'Bot Updating Templated Files' - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all - echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} - else - echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} - fi - mkdir -p ${TEMPDIR}/docs - git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/docs/docker-documentation - if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/docs/docker-documentation/docs/images/ - cd ${TEMPDIR}/docs/docker-documentation - git add docs/images/docker-${CONTAINER_NAME}.md - git commit -m 'Bot Updating Documentation' - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git --all - fi - mkdir -p ${TEMPDIR}/unraid - git clone https://github.com/linuxserver/docker-templates.git ${TEMPDIR}/unraid/docker-templates - git clone https://github.com/linuxserver/templates.git ${TEMPDIR}/unraid/templates - if [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-logo.png ]]; then - sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-logo.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml - elif [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-icon.png ]]; then - sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-icon.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml - fi - if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then - cd ${TEMPDIR}/unraid/templates/ - if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then - echo "Image is on the ignore list, marking Unraid template as deprecated" - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ - git add -u unraid/${CONTAINER_NAME}.xml - git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || : - git commit -m 'Bot Moving Deprecated Unraid Template' || : + withCredentials([ + [ + $class: 'UsernamePasswordMultiBinding', + credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207', + usernameVariable: 'DOCKERUSER', + passwordVariable: 'DOCKERPASS' + ] + ]) { + sh '''#! /bin/bash + set -e + TEMPDIR=$(mktemp -d) + docker pull ghcr.io/linuxserver/jenkins-builder:latest + docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest + # Stage 1 - Jenkinsfile update + if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then + mkdir -p ${TEMPDIR}/repo + git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} + cd ${TEMPDIR}/repo/${LS_REPO} + git checkout -f master + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/ + git add Jenkinsfile + git commit -m 'Bot Updating Templated Files' + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + echo "Updating Jenkinsfile" + rm -Rf ${TEMPDIR} + exit 0 else - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ - git add unraid/${CONTAINER_NAME}.xml - git commit -m 'Bot Updating Unraid Template' + echo "Jenkinsfile is up to date." fi - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git --all - fi - rm -Rf ${TEMPDIR}''' - script{ - env.FILES_UPDATED = sh( - script: '''cat /tmp/${COMMIT_SHA}-${BUILD_NUMBER}''', - returnStdout: true).trim() + # Stage 2 - Delete old templates + OLD_TEMPLATES=".github/ISSUE_TEMPLATE.md .github/ISSUE_TEMPLATE/issue.bug.md .github/ISSUE_TEMPLATE/issue.feature.md .github/workflows/call_invalid_helper.yml .github/workflows/stale.yml Dockerfile.armhf" + for i in ${OLD_TEMPLATES}; do + if [[ -f "${i}" ]]; then + TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}" + fi + done + if [[ -n "${TEMPLATES_TO_DELETE}" ]]; then + mkdir -p ${TEMPDIR}/repo + git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} + cd ${TEMPDIR}/repo/${LS_REPO} + git checkout -f master + for i in ${TEMPLATES_TO_DELETE}; do + git rm "${i}" + done + git commit -m 'Bot Updating Templated Files' + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + echo "Deleting old and deprecated templates" + rm -Rf ${TEMPDIR} + exit 0 + else + echo "No templates to delete" + fi + # Stage 3 - Update templates + CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) + cd ${TEMPDIR}/docker-${CONTAINER_NAME} + NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) + if [[ "${CURRENTHASH}" != "${NEWHASH}" ]] || ! grep -q '.jenkins-external' "${WORKSPACE}/.gitignore" 2>/dev/null; then + mkdir -p ${TEMPDIR}/repo + git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} + cd ${TEMPDIR}/repo/${LS_REPO} + git checkout -f master + cd ${TEMPDIR}/docker-${CONTAINER_NAME} + mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows + mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE + cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || : + cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || : + cd ${TEMPDIR}/repo/${LS_REPO}/ + if ! grep -q '.jenkins-external' .gitignore 2>/dev/null; then + echo ".jenkins-external" >> .gitignore + git add .gitignore + fi + git add readme-vars.yml ${TEMPLATED_FILES} + git commit -m 'Bot Updating Templated Files' + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + else + echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + fi + mkdir -p ${TEMPDIR}/docs + git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/docs/docker-documentation + if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/docs/docker-documentation/docs/images/ + cd ${TEMPDIR}/docs/docker-documentation + GH_DOCS_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||') + git add docs/images/docker-${CONTAINER_NAME}.md + git commit -m 'Bot Updating Documentation' + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} + fi + mkdir -p ${TEMPDIR}/unraid + git clone https://github.com/linuxserver/docker-templates.git ${TEMPDIR}/unraid/docker-templates + git clone https://github.com/linuxserver/templates.git ${TEMPDIR}/unraid/templates + if [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-logo.png ]]; then + sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-logo.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml + elif [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-icon.png ]]; then + sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-icon.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml + fi + if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then + cd ${TEMPDIR}/unraid/templates/ + GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||') + if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then + echo "Image is on the ignore list, marking Unraid template as deprecated" + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ + git add -u unraid/${CONTAINER_NAME}.xml + git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || : + git commit -m 'Bot Moving Deprecated Unraid Template' || : + else + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ + git add unraid/${CONTAINER_NAME}.xml + git commit -m 'Bot Updating Unraid Template' + fi + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH} + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH} + fi + # Stage 4 - Sync Readme to Docker Hub + if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]]; then + if [[ $(cat ${TEMPDIR}/docker-${CONTAINER_NAME}/README.md | wc -m) > 25000 ]]; then + echo "Readme is longer than 25,000 characters. Syncing the lite version to Docker Hub" + DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/README.lite" + else + echo "Syncing readme to Docker Hub" + DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/README.md" + fi + DH_TOKEN=$(curl -d '{"username":"'${DOCKERUSER}'", "password":"'${DOCKERHUB_TOKEN}'"}' -H "Content-Type: application/json" -X POST https://hub.docker.com/v2/users/login | jq -r '.token') + curl -s \ + -H "Authorization: JWT ${DH_TOKEN}" \ + -H "Content-Type: application/json" \ + -X PATCH \ + -d "{\\"full_description\\":$(jq -Rsa . ${DH_README_SYNC_PATH})}" \ + https://hub.docker.com/v2/repositories/${DOCKERHUB_IMAGE} || : + else + echo "Not the default Github branch. Skipping readme sync to Docker Hub." + fi + rm -Rf ${TEMPDIR}''' + script{ + env.FILES_UPDATED = sh( + script: '''cat /tmp/${COMMIT_SHA}-${BUILD_NUMBER}''', + returnStdout: true).trim() + } } } } @@ -560,7 +601,8 @@ pipeline { wait git add package_versions.txt git commit -m 'Bot Updating Package Versions' - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master echo "true" > /tmp/packages-${COMMIT_SHA}-${BUILD_NUMBER} echo "Package tag updated, stopping build process" else @@ -856,39 +898,6 @@ EOF ) ''' } } - // Use helper container to sync the current README on master to the dockerhub endpoint - stage('Sync-README') { - when { - environment name: 'CHANGE_ID', value: '' - environment name: 'EXIT_STATUS', value: '' - } - steps { - withCredentials([ - [ - $class: 'UsernamePasswordMultiBinding', - credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207', - usernameVariable: 'DOCKERUSER', - passwordVariable: 'DOCKERPASS' - ] - ]) { - sh '''#! /bin/bash - set -e - TEMPDIR=$(mktemp -d) - docker pull ghcr.io/linuxserver/jenkins-builder:latest - docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH="${BRANCH_NAME}" -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest - docker pull ghcr.io/linuxserver/readme-sync - docker run --rm=true \ - -e DOCKERHUB_USERNAME=$DOCKERUSER \ - -e DOCKERHUB_PASSWORD=$DOCKERPASS \ - -e GIT_REPOSITORY=${LS_USER}/${LS_REPO} \ - -e DOCKER_REPOSITORY=${IMAGE} \ - -e GIT_BRANCH=master \ - -v ${TEMPDIR}/docker-${CONTAINER_NAME}:/mnt \ - ghcr.io/linuxserver/readme-sync bash -c 'node sync' - rm -Rf ${TEMPDIR} ''' - } - } - } // If this is a Pull request send the CI link as a comment on it stage('Pull Request Comment') { when { From d7744c21df875472b6cb84d655ca9ec71041df5a Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Sat, 13 Jan 2024 02:03:34 +0000 Subject: [PATCH 09/22] Bot Updating Templated Files --- README.md | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 37bda75..724f0f8 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,6 @@ To help you get started creating a container from this image you can either use ```yaml --- -version: "2.1" services: plex: image: lscr.io/linuxserver/plex:latest @@ -251,7 +250,7 @@ We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to ## Updating Info -Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (ie. nextcloud, plex), we do not recommend or support updating apps inside the container. Please consult the [Application Setup](#application-setup) section above to see if it is recommended for the image. +Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (noted in the relevant readme.md), we do not recommend or support updating apps inside the container. Please consult the [Application Setup](#application-setup) section above to see if it is recommended for the image. Below are the instructions for updating containers: @@ -316,21 +315,6 @@ Below are the instructions for updating containers: docker image prune ``` -### Via Watchtower auto-updater (only use if you don't remember the original parameters) - -* Pull the latest image at its tag and replace it with the same env variables in one run: - - ```bash - docker run --rm \ - -v /var/run/docker.sock:/var/run/docker.sock \ - containrrr/watchtower \ - --run-once plex - ``` - -* You can also remove the old dangling images: `docker image prune` - -**warning**: We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose). - ### Image Update Notifications - Diun (Docker Image Update Notifier) **tip**: We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported. @@ -358,6 +342,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **09.01.24:** - Set ownership on TranscoderTempDirectory when it's been saved in Preferences. * **16.08.23:** - Install unrar from [linuxserver repo](https://github.com/linuxserver/docker-unrar). * **03.07.23:** - Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf) * **16.10.22:** - Rebase to jammy. Update to s6v3. Remove opencl packages (bundled with plex). From d20a2429e4a9b66bb5835cea7008e01131787ad5 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Sat, 13 Jan 2024 02:06:22 +0000 Subject: [PATCH 10/22] Bot Updating Package Versions --- package_versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_versions.txt b/package_versions.txt index 608d418..21abbe9 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -104,7 +104,7 @@ libsemanage-common 3.3-1build2 deb libsemanage2 3.3-1build2 deb libsepol2 3.3-1build1 deb libsmartcols1 2.37.2-4ubuntu3 deb -libsqlite3-0 3.37.2-2ubuntu0.1 deb +libsqlite3-0 3.37.2-2ubuntu0.3 deb libss2 1.46.5-2ubuntu1.1 deb libssh-4 0.9.6-2ubuntu0.22.04.2 deb libssl3 3.0.2-0ubuntu1.10 deb From 0ae63a4bc562b57bed6b749b9ad0ff750be1c75f Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Mon, 22 Jan 2024 09:20:00 +0000 Subject: [PATCH 11/22] Bot Updating Package Versions --- package_versions.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package_versions.txt b/package_versions.txt index 21abbe9..5fc70b6 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -119,7 +119,7 @@ libunistring2 1.0-1 deb libuuid1 2.37.2-4ubuntu3 deb libxxhash0 0.8.1-1 deb libzstd1 1.4.8+dfsg-3build1 deb -locales 2.35-0ubuntu3.5 deb +locales 2.35-0ubuntu3.6 deb login 1:4.8.1-2ubuntu2.1 deb logsave 1.46.5-2ubuntu1.1 deb lsb-base 11.1.0ubuntu4 deb @@ -139,10 +139,10 @@ publicsuffix 20211207.1025-1 deb readline-common 8.1.2-1 deb sed 4.8-1ubuntu2 deb sensible-utils 0.0.17 deb -systemd-hwe-hwdb 249.11.4 deb +systemd-hwe-hwdb 249.11.5 deb sysvinit-utils 3.01-1ubuntu1 deb tar 1.34+dfsg-1ubuntu0.1.22.04.1 deb -tzdata 2023c-0ubuntu0.22.04.2 deb +tzdata 2023d-0ubuntu0.22.04 deb ubuntu-keyring 2021.03.26 deb udev 249.11-0ubuntu3.11 deb usrmerge 25ubuntu2 deb From e3027d6d978cc29c34694b8458ac649feea4819c Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Mon, 29 Jan 2024 09:18:09 +0000 Subject: [PATCH 12/22] Bot Updating Package Versions --- package_versions.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package_versions.txt b/package_versions.txt index 5fc70b6..18d883d 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -106,7 +106,7 @@ libsepol2 3.3-1build1 deb libsmartcols1 2.37.2-4ubuntu3 deb libsqlite3-0 3.37.2-2ubuntu0.3 deb libss2 1.46.5-2ubuntu1.1 deb -libssh-4 0.9.6-2ubuntu0.22.04.2 deb +libssh-4 0.9.6-2ubuntu0.22.04.3 deb libssl3 3.0.2-0ubuntu1.10 deb libstdc++6 12.1.0-2ubuntu1~22.04 deb libsystemd0 249.11-0ubuntu3.9 deb @@ -114,7 +114,7 @@ libtasn1-6 4.18.0-4build1 deb libtinfo6 6.3-2ubuntu0.1 deb libtirpc-common 1.3.2-2ubuntu0.1 deb libtirpc3 1.3.2-2ubuntu0.1 deb -libudev1 249.11-0ubuntu3.11 deb +libudev1 249.11-0ubuntu3.12 deb libunistring2 1.0-1 deb libuuid1 2.37.2-4ubuntu3 deb libxxhash0 0.8.1-1 deb @@ -144,7 +144,7 @@ sysvinit-utils 3.01-1ubuntu1 deb tar 1.34+dfsg-1ubuntu0.1.22.04.1 deb tzdata 2023d-0ubuntu0.22.04 deb ubuntu-keyring 2021.03.26 deb -udev 249.11-0ubuntu3.11 deb +udev 249.11-0ubuntu3.12 deb usrmerge 25ubuntu2 deb util-linux 2.37.2-4ubuntu3 deb wget 1.21.2-2ubuntu1 deb From 46f56aecf89aa2df9800aac7a9cfa7648b6445ed Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Mon, 5 Feb 2024 09:18:09 +0000 Subject: [PATCH 13/22] Bot Updating Package Versions --- package_versions.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package_versions.txt b/package_versions.txt index 18d883d..4aff971 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -71,8 +71,8 @@ libkmod2 29-1ubuntu1 deb libkrb5-3 1.19.2-2ubuntu0.2 deb libkrb5support0 1.19.2-2ubuntu0.2 deb libksba8 1.6.0-2ubuntu0.2 deb -libldap-2.5-0 2.5.16+dfsg-0ubuntu0.22.04.1 deb -libldap-common 2.5.16+dfsg-0ubuntu0.22.04.1 deb +libldap-2.5-0 2.5.16+dfsg-0ubuntu0.22.04.2 deb +libldap-common 2.5.16+dfsg-0ubuntu0.22.04.2 deb liblz4-1 1.9.3-2build2 deb liblzma5 5.2.5-2ubuntu1 deb libmd0 1.0.4-1build1 deb @@ -129,7 +129,7 @@ ncurses-base 6.3-2ubuntu0.1 deb ncurses-bin 6.3-2ubuntu0.1 deb netcat 1.218-4ubuntu1 deb netcat-openbsd 1.218-4ubuntu1 deb -openssl 3.0.2-0ubuntu1.12 deb +openssl 3.0.2-0ubuntu1.13 deb passwd 1:4.8.1-2ubuntu2.1 deb perl-base 5.34.0-3ubuntu1.2 deb pinentry-curses 1.1.1-1build2 deb From 230cccde16900e0a8ed14cf09b0c1e26d993a976 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Mon, 12 Feb 2024 09:20:18 +0000 Subject: [PATCH 14/22] Bot Updating Package Versions --- package_versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_versions.txt b/package_versions.txt index 4aff971..ac976d6 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -129,7 +129,7 @@ ncurses-base 6.3-2ubuntu0.1 deb ncurses-bin 6.3-2ubuntu0.1 deb netcat 1.218-4ubuntu1 deb netcat-openbsd 1.218-4ubuntu1 deb -openssl 3.0.2-0ubuntu1.13 deb +openssl 3.0.2-0ubuntu1.14 deb passwd 1:4.8.1-2ubuntu2.1 deb perl-base 5.34.0-3ubuntu1.2 deb pinentry-curses 1.1.1-1build2 deb From c41c4b18157bcf599c00eacac9c5702cc9a415dd Mon Sep 17 00:00:00 2001 From: Roxedus Date: Mon, 12 Feb 2024 19:07:45 +0100 Subject: [PATCH 15/22] Switch to readme_hwaccel --- README.md | 26 ++++++++++++++++---------- readme-vars.yml | 27 +++++---------------------- 2 files changed, 21 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 724f0f8..01e953c 100644 --- a/README.md +++ b/README.md @@ -61,38 +61,43 @@ The architectures supported by this image are: Webui can be found at `:32400/web` -** Note about updates, if there is no value set for the VERSION variable, then no updates will take place.** +**note**: If there is no value set for the VERSION variable, then no updates will take place. -** For new users, no updates will take place on the first run of the container as there is no preferences file to read your token from, to update restart the Docker container after logging in through the webui** +**note**: For new users, no updates will take place on the first run of the container as there is no preferences file to read your token from, to update restart the Docker container after logging in through the webui. Valid settings for VERSION are:- -`IMPORTANT NOTE:- YOU CANNOT UPDATE TO A PLEXPASS ONLY (BETA) VERSION IF YOU ARE NOT LOGGED IN WITH A PLEXPASS ACCOUNT` +**info**: YOU CANNOT UPDATE TO A PLEXPASS ONLY (BETA) VERSION IF YOU ARE NOT LOGGED IN WITH A PLEXPASS ACCOUNT. + **`docker`**: Let Docker handle the Plex Version, we keep our Dockerhub Endpoint up to date with the latest public builds. This is the same as leaving this setting out of your create command. + **`latest`**: will update plex to the latest version available that you are entitled to. + **`public`**: will update plexpass users to the latest public version, useful for plexpass users that don't want to be on the bleeding edge but still want the latest public updates. + **``**: will select a specific version (eg 0.9.12.4.1192-9a47d21) of plex to install, note you cannot use this to access plexpass versions if you do not have plexpass. -## Hardware Acceleration +### Hardware Acceleration -### Intel +Many desktop application will need access to a GPU to function properly and even some Desktop Environments have compisitor effects that will not function without a GPU. This is not a hard requirement and all base images will function without a video device mounted into the container. -Hardware acceleration users for Intel Quicksync will need to mount their /dev/dri video device inside of the container by passing the following command when running or creating the container: +#### Intel/ATI/AMD -``` +To leverage hardware acceleration you will need to mount /dev/dri video device inside of the container. + +```text --device=/dev/dri:/dev/dri ``` We will automatically ensure the abc user inside of the container has the proper permissions to access this device. -### Nvidia +#### Nvidia Hardware acceleration users for Nvidia will need to install the container runtime provided by Nvidia on their host, instructions can be found here: - https://github.com/NVIDIA/nvidia-docker -We automatically add the necessary environment variable that will utilise all the features available on a GPU on the host. Once nvidia-docker is installed on your host you will need to re/create the docker container with the nvidia container runtime `--runtime=nvidia` and add an environment variable `-e NVIDIA_VISIBLE_DEVICES=all` (can also be set to a specific gpu's UUID, this can be discovered by running `nvidia-smi --query-gpu=gpu_name,gpu_uuid --format=csv` ). NVIDIA automatically mounts the GPU and drivers from your host into the plex docker. +We automatically add the necessary environment variable that will utilise all the features available on a GPU on the host. Once nvidia-docker is installed on your host you will need to re/create the docker container with the nvidia container runtime `--runtime=nvidia` and add an environment variable `-e NVIDIA_VISIBLE_DEVICES=all` (can also be set to a specific gpu's UUID, this can be discovered by running `nvidia-smi --query-gpu=gpu_name,gpu_uuid --format=csv` ). NVIDIA automatically mounts the GPU and drivers from your host into the container. + +#### Arm Devices + +Best effort is made to install tools to allow mounting in /dev/dri on Arm devices. In most cases if /dev/dri exists on the host it should just work. If running a Raspberry Pi 4 be sure to enable `dtoverlay=vc4-fkms-v3d` in your usercfg.txt. ## Usage @@ -342,6 +347,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **12.02.24:** - Use universal hardware acceleration blurb * **09.01.24:** - Set ownership on TranscoderTempDirectory when it's been saved in Preferences. * **16.08.23:** - Install unrar from [linuxserver repo](https://github.com/linuxserver/docker-unrar). * **03.07.23:** - Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf) diff --git a/readme-vars.yml b/readme-vars.yml index f8a8d87..d37392e 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -61,40 +61,23 @@ app_setup_block_enabled: true app_setup_block: | Webui can be found at `:32400/web` - ** Note about updates, if there is no value set for the VERSION variable, then no updates will take place.** + ?+note[Updates](|If there is no value set for the VERSION variable, then no updates will take place.|) - ** For new users, no updates will take place on the first run of the container as there is no preferences file to read your token from, to update restart the Docker container after logging in through the webui** + ?+note[New users](|For new users, no updates will take place on the first run of the container as there is no preferences file to read your token from, to update restart the Docker container after logging in through the webui.|) Valid settings for VERSION are:- - `IMPORTANT NOTE:- YOU CANNOT UPDATE TO A PLEXPASS ONLY (BETA) VERSION IF YOU ARE NOT LOGGED IN WITH A PLEXPASS ACCOUNT` + ?+info[Plexpass](|YOU CANNOT UPDATE TO A PLEXPASS ONLY (BETA) VERSION IF YOU ARE NOT LOGGED IN WITH A PLEXPASS ACCOUNT.|) + **`docker`**: Let Docker handle the Plex Version, we keep our Dockerhub Endpoint up to date with the latest public builds. This is the same as leaving this setting out of your create command. + **`latest`**: will update plex to the latest version available that you are entitled to. + **`public`**: will update plexpass users to the latest public version, useful for plexpass users that don't want to be on the bleeding edge but still want the latest public updates. + **``**: will select a specific version (eg 0.9.12.4.1192-9a47d21) of plex to install, note you cannot use this to access plexpass versions if you do not have plexpass. - ## Hardware Acceleration - - ### Intel - - Hardware acceleration users for Intel Quicksync will need to mount their /dev/dri video device inside of the container by passing the following command when running or creating the container: - - ``` - --device=/dev/dri:/dev/dri - ``` - - We will automatically ensure the abc user inside of the container has the proper permissions to access this device. - - ### Nvidia - - Hardware acceleration users for Nvidia will need to install the container runtime provided by Nvidia on their host, instructions can be found here: - - https://github.com/NVIDIA/nvidia-docker - - We automatically add the necessary environment variable that will utilise all the features available on a GPU on the host. Once nvidia-docker is installed on your host you will need to re/create the docker container with the nvidia container runtime `--runtime=nvidia` and add an environment variable `-e NVIDIA_VISIBLE_DEVICES=all` (can also be set to a specific gpu's UUID, this can be discovered by running `nvidia-smi --query-gpu=gpu_name,gpu_uuid --format=csv` ). NVIDIA automatically mounts the GPU and drivers from your host into the plex docker. +readme_hwaccel: true # changelog changelogs: + - {date: "12.02.24:", desc: "Use universal hardware acceleration blurb"} - {date: "09.01.24:", desc: "Set ownership on TranscoderTempDirectory when it's been saved in Preferences."} - {date: "16.08.23:", desc: "Install unrar from [linuxserver repo](https://github.com/linuxserver/docker-unrar)."} - {date: "03.07.23:", desc: "Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)"} From f561004964cdb2cb06bdd2f6c9253b35c4c680c9 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Tue, 13 Feb 2024 17:29:18 +0000 Subject: [PATCH 16/22] Bot Updating Package Versions --- package_versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_versions.txt b/package_versions.txt index ac976d6..8e06ea2 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -133,7 +133,7 @@ openssl 3.0.2-0ubuntu1.14 deb passwd 1:4.8.1-2ubuntu2.1 deb perl-base 5.34.0-3ubuntu1.2 deb pinentry-curses 1.1.1-1build2 deb -plexmediaserver 1.32.8.7639-fb6452ebf deb +plexmediaserver 1.40.0.7998-c29d4c0c8 deb procps 2:3.3.17-6ubuntu2 deb publicsuffix 20211207.1025-1 deb readline-common 8.1.2-1 deb From 2b397aa4b54a25fee3a480d6184558074ced5005 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Mon, 26 Feb 2024 09:18:23 +0000 Subject: [PATCH 17/22] Bot Updating Templated Files --- Jenkinsfile | 297 +++++++++++++++++++++++++--------------------------- 1 file changed, 143 insertions(+), 154 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1d41743..5ca3a68 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -247,9 +247,11 @@ pipeline { -v ${WORKSPACE}:/mnt \ -e AWS_ACCESS_KEY_ID=\"${S3_KEY}\" \ -e AWS_SECRET_ACCESS_KEY=\"${S3_SECRET}\" \ - ghcr.io/linuxserver/baseimage-alpine:3.17 s6-envdir -fn -- /var/run/s6/container_environment /bin/bash -c "\ - apk add --no-cache py3-pip && \ - pip install s3cmd && \ + ghcr.io/linuxserver/baseimage-alpine:3.19 s6-envdir -fn -- /var/run/s6/container_environment /bin/bash -c "\ + apk add --no-cache python3 && \ + python3 -m venv /lsiopy && \ + pip install --no-cache-dir -U pip && \ + pip install --no-cache-dir s3cmd && \ s3cmd put --no-preserve --acl-public -m text/xml /mnt/shellcheck-result.xml s3://ci-tests.linuxserver.io/${IMAGE}/${META_TAG}/shellcheck-result.xml" || :''' } } @@ -264,150 +266,149 @@ pipeline { } } steps { - withCredentials([ - [ - $class: 'UsernamePasswordMultiBinding', - credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207', - usernameVariable: 'DOCKERUSER', - passwordVariable: 'DOCKERPASS' - ] - ]) { - sh '''#! /bin/bash - set -e - TEMPDIR=$(mktemp -d) - docker pull ghcr.io/linuxserver/jenkins-builder:latest - docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest - # Stage 1 - Jenkinsfile update - if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then - mkdir -p ${TEMPDIR}/repo - git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} - cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f master - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/ - git add Jenkinsfile - git commit -m 'Bot Updating Templated Files' - git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master - echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} - echo "Updating Jenkinsfile" - rm -Rf ${TEMPDIR} - exit 0 - else - echo "Jenkinsfile is up to date." + sh '''#! /bin/bash + set -e + TEMPDIR=$(mktemp -d) + docker pull ghcr.io/linuxserver/jenkins-builder:latest + docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest + # Stage 1 - Jenkinsfile update + if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then + mkdir -p ${TEMPDIR}/repo + git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} + cd ${TEMPDIR}/repo/${LS_REPO} + git checkout -f master + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/ + git add Jenkinsfile + git commit -m 'Bot Updating Templated Files' + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + echo "Updating Jenkinsfile" + rm -Rf ${TEMPDIR} + exit 0 + else + echo "Jenkinsfile is up to date." + fi + # Stage 2 - Delete old templates + OLD_TEMPLATES=".github/ISSUE_TEMPLATE.md .github/ISSUE_TEMPLATE/issue.bug.md .github/ISSUE_TEMPLATE/issue.feature.md .github/workflows/call_invalid_helper.yml .github/workflows/stale.yml Dockerfile.armhf" + for i in ${OLD_TEMPLATES}; do + if [[ -f "${i}" ]]; then + TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}" fi - # Stage 2 - Delete old templates - OLD_TEMPLATES=".github/ISSUE_TEMPLATE.md .github/ISSUE_TEMPLATE/issue.bug.md .github/ISSUE_TEMPLATE/issue.feature.md .github/workflows/call_invalid_helper.yml .github/workflows/stale.yml Dockerfile.armhf" - for i in ${OLD_TEMPLATES}; do - if [[ -f "${i}" ]]; then - TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}" - fi + done + if [[ -n "${TEMPLATES_TO_DELETE}" ]]; then + mkdir -p ${TEMPDIR}/repo + git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} + cd ${TEMPDIR}/repo/${LS_REPO} + git checkout -f master + for i in ${TEMPLATES_TO_DELETE}; do + git rm "${i}" done - if [[ -n "${TEMPLATES_TO_DELETE}" ]]; then - mkdir -p ${TEMPDIR}/repo - git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} - cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f master - for i in ${TEMPLATES_TO_DELETE}; do - git rm "${i}" - done - git commit -m 'Bot Updating Templated Files' - git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master - echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} - echo "Deleting old and deprecated templates" - rm -Rf ${TEMPDIR} - exit 0 - else - echo "No templates to delete" - fi - # Stage 3 - Update templates - CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) + git commit -m 'Bot Updating Templated Files' + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + echo "Deleting old and deprecated templates" + rm -Rf ${TEMPDIR} + exit 0 + else + echo "No templates to delete" + fi + # Stage 3 - Update templates + CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) + cd ${TEMPDIR}/docker-${CONTAINER_NAME} + NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) + if [[ "${CURRENTHASH}" != "${NEWHASH}" ]] || ! grep -q '.jenkins-external' "${WORKSPACE}/.gitignore" 2>/dev/null; then + mkdir -p ${TEMPDIR}/repo + git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} + cd ${TEMPDIR}/repo/${LS_REPO} + git checkout -f master cd ${TEMPDIR}/docker-${CONTAINER_NAME} - NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) - if [[ "${CURRENTHASH}" != "${NEWHASH}" ]] || ! grep -q '.jenkins-external' "${WORKSPACE}/.gitignore" 2>/dev/null; then - mkdir -p ${TEMPDIR}/repo - git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} - cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f master - cd ${TEMPDIR}/docker-${CONTAINER_NAME} - mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows - mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE - cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || : - cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || : - cd ${TEMPDIR}/repo/${LS_REPO}/ - if ! grep -q '.jenkins-external' .gitignore 2>/dev/null; then - echo ".jenkins-external" >> .gitignore - git add .gitignore - fi - git add readme-vars.yml ${TEMPLATED_FILES} - git commit -m 'Bot Updating Templated Files' - git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master - echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows + mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE + cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || : + cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || : + cd ${TEMPDIR}/repo/${LS_REPO}/ + if ! grep -q '.jenkins-external' .gitignore 2>/dev/null; then + echo ".jenkins-external" >> .gitignore + git add .gitignore + fi + git add readme-vars.yml ${TEMPLATED_FILES} + git commit -m 'Bot Updating Templated Files' + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master + echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + else + echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + fi + mkdir -p ${TEMPDIR}/docs + git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/docs/docker-documentation + if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/docs/docker-documentation/docs/images/ + cd ${TEMPDIR}/docs/docker-documentation + GH_DOCS_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||') + git add docs/images/docker-${CONTAINER_NAME}.md + git commit -m 'Bot Updating Documentation' + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} || \ + (MAXWAIT="10" && echo "Push to docs failed, trying again in ${MAXWAIT} seconds" && \ + sleep $((RANDOM % MAXWAIT)) && \ + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase && \ + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH}) + fi + mkdir -p ${TEMPDIR}/unraid + git clone https://github.com/linuxserver/docker-templates.git ${TEMPDIR}/unraid/docker-templates + git clone https://github.com/linuxserver/templates.git ${TEMPDIR}/unraid/templates + if [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-logo.png ]]; then + sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-logo.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml + elif [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-icon.png ]]; then + sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-icon.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml + fi + if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then + cd ${TEMPDIR}/unraid/templates/ + GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||') + if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then + echo "Image is on the ignore list, marking Unraid template as deprecated" + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ + git add -u unraid/${CONTAINER_NAME}.xml + git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || : + git commit -m 'Bot Moving Deprecated Unraid Template' || : else - echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ + git add unraid/${CONTAINER_NAME}.xml + git commit -m 'Bot Updating Unraid Template' fi - mkdir -p ${TEMPDIR}/docs - git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/docs/docker-documentation - if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/docs/docker-documentation/docs/images/ - cd ${TEMPDIR}/docs/docker-documentation - GH_DOCS_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||') - git add docs/images/docker-${CONTAINER_NAME}.md - git commit -m 'Bot Updating Documentation' - git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} - fi - mkdir -p ${TEMPDIR}/unraid - git clone https://github.com/linuxserver/docker-templates.git ${TEMPDIR}/unraid/docker-templates - git clone https://github.com/linuxserver/templates.git ${TEMPDIR}/unraid/templates - if [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-logo.png ]]; then - sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-logo.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml - elif [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-icon.png ]]; then - sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-icon.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml - fi - if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then - cd ${TEMPDIR}/unraid/templates/ - GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||') - if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then - echo "Image is on the ignore list, marking Unraid template as deprecated" - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ - git add -u unraid/${CONTAINER_NAME}.xml - git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || : - git commit -m 'Bot Moving Deprecated Unraid Template' || : - else - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ - git add unraid/${CONTAINER_NAME}.xml - git commit -m 'Bot Updating Unraid Template' - fi - git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH} - git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH} - fi - # Stage 4 - Sync Readme to Docker Hub - if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]]; then - if [[ $(cat ${TEMPDIR}/docker-${CONTAINER_NAME}/README.md | wc -m) > 25000 ]]; then - echo "Readme is longer than 25,000 characters. Syncing the lite version to Docker Hub" - DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/README.lite" - else - echo "Syncing readme to Docker Hub" - DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/README.md" - fi - DH_TOKEN=$(curl -d '{"username":"'${DOCKERUSER}'", "password":"'${DOCKERHUB_TOKEN}'"}' -H "Content-Type: application/json" -X POST https://hub.docker.com/v2/users/login | jq -r '.token') - curl -s \ - -H "Authorization: JWT ${DH_TOKEN}" \ - -H "Content-Type: application/json" \ - -X PATCH \ - -d "{\\"full_description\\":$(jq -Rsa . ${DH_README_SYNC_PATH})}" \ - https://hub.docker.com/v2/repositories/${DOCKERHUB_IMAGE} || : + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH} --rebase + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH} || \ + (MAXWAIT="10" && echo "Push to unraid templates failed, trying again in ${MAXWAIT} seconds" && \ + sleep $((RANDOM % MAXWAIT)) && \ + git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH} --rebase && \ + git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH}) + fi + # Stage 4 - Sync Readme to Docker Hub + if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]]; then + if [[ $(cat ${TEMPDIR}/docker-${CONTAINER_NAME}/README.md | wc -m) > 25000 ]]; then + echo "Readme is longer than 25,000 characters. Syncing the lite version to Docker Hub" + DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/README.lite" else - echo "Not the default Github branch. Skipping readme sync to Docker Hub." + echo "Syncing readme to Docker Hub" + DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/README.md" fi - rm -Rf ${TEMPDIR}''' - script{ - env.FILES_UPDATED = sh( - script: '''cat /tmp/${COMMIT_SHA}-${BUILD_NUMBER}''', - returnStdout: true).trim() - } + DH_TOKEN=$(curl -d '{"username":"linuxserverci", "password":"'${DOCKERHUB_TOKEN}'"}' -H "Content-Type: application/json" -X POST https://hub.docker.com/v2/users/login | jq -r '.token') + curl -s \ + -H "Authorization: JWT ${DH_TOKEN}" \ + -H "Content-Type: application/json" \ + -X PATCH \ + -d "{\\"full_description\\":$(jq -Rsa . ${DH_README_SYNC_PATH})}" \ + https://hub.docker.com/v2/repositories/${DOCKERHUB_IMAGE} || : + else + echo "Not the default Github branch. Skipping readme sync to Docker Hub." + fi + rm -Rf ${TEMPDIR}''' + script{ + env.FILES_UPDATED = sh( + script: '''cat /tmp/${COMMIT_SHA}-${BUILD_NUMBER}''', + returnStdout: true).trim() } } } @@ -705,12 +706,6 @@ pipeline { } steps { withCredentials([ - [ - $class: 'UsernamePasswordMultiBinding', - credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207', - usernameVariable: 'DOCKERUSER', - passwordVariable: 'DOCKERPASS' - ], [ $class: 'UsernamePasswordMultiBinding', credentialsId: 'Quay.io-Robot', @@ -721,7 +716,7 @@ pipeline { retry(5) { sh '''#! /bin/bash set -e - echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin + echo $DOCKERHUB_TOKEN | docker login -u linuxserverci --password-stdin echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin @@ -752,12 +747,6 @@ pipeline { } steps { withCredentials([ - [ - $class: 'UsernamePasswordMultiBinding', - credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207', - usernameVariable: 'DOCKERUSER', - passwordVariable: 'DOCKERPASS' - ], [ $class: 'UsernamePasswordMultiBinding', credentialsId: 'Quay.io-Robot', @@ -768,7 +757,7 @@ pipeline { retry(5) { sh '''#! /bin/bash set -e - echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin + echo $DOCKERHUB_TOKEN | docker login -u linuxserverci --password-stdin echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin From 094a15b4aae87e94988057c4fc266d595363e8c4 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Mon, 26 Feb 2024 09:21:56 +0000 Subject: [PATCH 18/22] Bot Updating Templated Files --- .github/ISSUE_TEMPLATE/issue.bug.yml | 4 ++-- .github/workflows/external_trigger.yml | 2 +- .github/workflows/external_trigger_scheduler.yml | 2 +- .github/workflows/package_trigger.yml | 2 +- .github/workflows/package_trigger_scheduler.yml | 2 +- README.md | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/issue.bug.yml b/.github/ISSUE_TEMPLATE/issue.bug.yml index ce3d19a..6c6659a 100755 --- a/.github/ISSUE_TEMPLATE/issue.bug.yml +++ b/.github/ISSUE_TEMPLATE/issue.bug.yml @@ -67,10 +67,10 @@ body: - type: textarea attributes: description: | - Provide a full docker log, output of "docker logs linuxserver.io" + Provide a full docker log, output of "docker logs plex" label: Container logs placeholder: | - Output of `docker logs linuxserver.io` + Output of `docker logs plex` render: bash validations: required: true diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index 3323f8e..2c00913 100644 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -7,7 +7,7 @@ jobs: external-trigger-master: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.1 - name: External Trigger if: github.ref == 'refs/heads/master' diff --git a/.github/workflows/external_trigger_scheduler.yml b/.github/workflows/external_trigger_scheduler.yml index c12a6ac..c48d8ed 100644 --- a/.github/workflows/external_trigger_scheduler.yml +++ b/.github/workflows/external_trigger_scheduler.yml @@ -9,7 +9,7 @@ jobs: external-trigger-scheduler: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.1 with: fetch-depth: '0' diff --git a/.github/workflows/package_trigger.yml b/.github/workflows/package_trigger.yml index c6e55ef..42a5652 100644 --- a/.github/workflows/package_trigger.yml +++ b/.github/workflows/package_trigger.yml @@ -7,7 +7,7 @@ jobs: package-trigger-master: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.1 - name: Package Trigger if: github.ref == 'refs/heads/master' diff --git a/.github/workflows/package_trigger_scheduler.yml b/.github/workflows/package_trigger_scheduler.yml index 47a72fb..fb3926a 100644 --- a/.github/workflows/package_trigger_scheduler.yml +++ b/.github/workflows/package_trigger_scheduler.yml @@ -9,7 +9,7 @@ jobs: package-trigger-scheduler: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4.1.1 with: fetch-depth: '0' diff --git a/README.md b/README.md index 01e953c..9277b97 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Valid settings for VERSION are:- ### Hardware Acceleration -Many desktop application will need access to a GPU to function properly and even some Desktop Environments have compisitor effects that will not function without a GPU. This is not a hard requirement and all base images will function without a video device mounted into the container. +Many desktop applications need access to a GPU to function properly and even some Desktop Environments have compositor effects that will not function without a GPU. However this is not a hard requirement and all base images will function without a video device mounted into the container. #### Intel/ATI/AMD @@ -91,9 +91,9 @@ We will automatically ensure the abc user inside of the container has the proper #### Nvidia Hardware acceleration users for Nvidia will need to install the container runtime provided by Nvidia on their host, instructions can be found here: -https://github.com/NVIDIA/nvidia-docker +https://github.com/NVIDIA/nvidia-container-toolkit -We automatically add the necessary environment variable that will utilise all the features available on a GPU on the host. Once nvidia-docker is installed on your host you will need to re/create the docker container with the nvidia container runtime `--runtime=nvidia` and add an environment variable `-e NVIDIA_VISIBLE_DEVICES=all` (can also be set to a specific gpu's UUID, this can be discovered by running `nvidia-smi --query-gpu=gpu_name,gpu_uuid --format=csv` ). NVIDIA automatically mounts the GPU and drivers from your host into the container. +We automatically add the necessary environment variable that will utilise all the features available on a GPU on the host. Once nvidia-container-toolkit is installed on your host you will need to re/create the docker container with the nvidia container runtime `--runtime=nvidia` and add an environment variable `-e NVIDIA_VISIBLE_DEVICES=all` (can also be set to a specific gpu's UUID, this can be discovered by running `nvidia-smi --query-gpu=gpu_name,gpu_uuid --format=csv` ). NVIDIA automatically mounts the GPU and drivers from your host into the container. #### Arm Devices From 53f70c08bcc78ee43a5adada00779e1fbfda479b Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Mon, 4 Mar 2024 11:11:30 +0000 Subject: [PATCH 19/22] Bot Updating Package Versions --- package_versions.txt | 302 +++++++++++++++++++++---------------------- 1 file changed, 151 insertions(+), 151 deletions(-) diff --git a/package_versions.txt b/package_versions.txt index 8e06ea2..27e1cb2 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -1,151 +1,151 @@ -NAME VERSION TYPE -adduser 3.118ubuntu5 deb -apt 2.4.11 deb -apt-utils 2.4.11 deb -base-files 12ubuntu4.3 deb -base-passwd 3.5.52build1 deb -bash 5.1-6ubuntu1 deb -bash 5.1.16 binary -bsdutils 1:2.37.2-4ubuntu3 deb -ca-certificates 20230311ubuntu0.22.04.1 deb -coreutils 8.32-4.1ubuntu1 deb -cron 3.0pl1-137ubuntu3 deb -curl 7.81.0-1ubuntu1.15 deb -dash 0.5.11+git20210903+057cd650a4ed-3build1 deb -debconf 1.5.79ubuntu1 deb -debianutils 5.5-1ubuntu2 deb -diffutils 1:3.8-0ubuntu2 deb -dirmngr 2.2.27-3ubuntu2.1 deb -dpkg 1.21.1ubuntu2.2 deb -e2fsprogs 1.46.5-2ubuntu1.1 deb -findutils 4.8.0-1ubuntu3 deb -gcc-12-base 12.1.0-2ubuntu1~22.04 deb -gnupg 2.2.27-3ubuntu2.1 deb -gnupg-l10n 2.2.27-3ubuntu2.1 deb -gnupg-utils 2.2.27-3ubuntu2.1 deb -gpg 2.2.27-3ubuntu2.1 deb -gpg-agent 2.2.27-3ubuntu2.1 deb -gpg-wks-client 2.2.27-3ubuntu2.1 deb -gpg-wks-server 2.2.27-3ubuntu2.1 deb -gpgconf 2.2.27-3ubuntu2.1 deb -gpgsm 2.2.27-3ubuntu2.1 deb -gpgv 2.2.27-3ubuntu2.1 deb -grep 3.7-1build1 deb -gzip 1.10-4ubuntu4.1 deb -hostname 3.23ubuntu2 deb -init-system-helpers 1.62 deb -jq 1.6-2.1ubuntu3 deb -libacl1 2.3.1-1 deb -libapt-pkg6.0 2.4.11 deb -libassuan0 2.5.5-1build1 deb -libattr1 1:2.5.1-1build1 deb -libaudit-common 1:3.0.7-1build1 deb -libaudit1 1:3.0.7-1build1 deb -libblkid1 2.37.2-4ubuntu3 deb -libbrotli1 1.0.9-2build6 deb -libbsd0 0.11.5-1 deb -libbz2-1.0 1.0.8-5build1 deb -libc-bin 2.35-0ubuntu3.1 deb -libc6 2.35-0ubuntu3.1 deb -libcap-ng0 0.7.9-2.2build3 deb -libcap2 1:2.44-1ubuntu0.22.04.1 deb -libcom-err2 1.46.5-2ubuntu1.1 deb -libcrypt1 1:4.4.27-1 deb -libcurl4 7.81.0-1ubuntu1.15 deb -libdb5.3 5.3.28+dfsg1-0.8ubuntu3 deb -libdebconfclient0 0.261ubuntu1 deb -libext2fs2 1.46.5-2ubuntu1.1 deb -libffi8 3.4.2-4 deb -libgcc-s1 12.1.0-2ubuntu1~22.04 deb -libgcrypt20 1.9.4-3ubuntu3 deb -libgmp10 2:6.2.1+dfsg-3ubuntu1 deb -libgnutls30 3.7.3-4ubuntu1.2 deb -libgpg-error0 1.43-3 deb -libgssapi-krb5-2 1.19.2-2ubuntu0.2 deb -libhogweed6 3.7.3-1build2 deb -libidn2-0 2.3.2-2build1 deb -libjq1 1.6-2.1ubuntu3 deb -libk5crypto3 1.19.2-2ubuntu0.2 deb -libkeyutils1 1.6.1-2ubuntu3 deb -libkmod2 29-1ubuntu1 deb -libkrb5-3 1.19.2-2ubuntu0.2 deb -libkrb5support0 1.19.2-2ubuntu0.2 deb -libksba8 1.6.0-2ubuntu0.2 deb -libldap-2.5-0 2.5.16+dfsg-0ubuntu0.22.04.2 deb -libldap-common 2.5.16+dfsg-0ubuntu0.22.04.2 deb -liblz4-1 1.9.3-2build2 deb -liblzma5 5.2.5-2ubuntu1 deb -libmd0 1.0.4-1build1 deb -libmount1 2.37.2-4ubuntu3 deb -libncurses6 6.3-2ubuntu0.1 deb -libncursesw6 6.3-2ubuntu0.1 deb -libnettle8 3.7.3-1build2 deb -libnghttp2-14 1.43.0-1ubuntu0.1 deb -libnpth0 1.6-3build2 deb -libnsl2 1.3.0-2build2 deb -libonig5 6.9.7.1-2build1 deb -libp11-kit0 0.24.0-6build1 deb -libpam-modules 1.4.0-11ubuntu2.3 deb -libpam-modules-bin 1.4.0-11ubuntu2.3 deb -libpam-runtime 1.4.0-11ubuntu2.3 deb -libpam0g 1.4.0-11ubuntu2.3 deb -libpcre2-8-0 10.39-3ubuntu0.1 deb -libpcre3 2:8.39-13ubuntu0.22.04.1 deb -libprocps8 2:3.3.17-6ubuntu2 deb -libpsl5 0.21.0-1.2build2 deb -libreadline8 8.1.2-1 deb -librtmp1 2.4+20151223.gitfa8646d.1-2build4 deb -libsasl2-2 2.1.27+dfsg2-3ubuntu1.2 deb -libsasl2-modules 2.1.27+dfsg2-3ubuntu1.2 deb -libsasl2-modules-db 2.1.27+dfsg2-3ubuntu1.2 deb -libseccomp2 2.5.3-2ubuntu2 deb -libselinux1 3.3-1build2 deb -libsemanage-common 3.3-1build2 deb -libsemanage2 3.3-1build2 deb -libsepol2 3.3-1build1 deb -libsmartcols1 2.37.2-4ubuntu3 deb -libsqlite3-0 3.37.2-2ubuntu0.3 deb -libss2 1.46.5-2ubuntu1.1 deb -libssh-4 0.9.6-2ubuntu0.22.04.3 deb -libssl3 3.0.2-0ubuntu1.10 deb -libstdc++6 12.1.0-2ubuntu1~22.04 deb -libsystemd0 249.11-0ubuntu3.9 deb -libtasn1-6 4.18.0-4build1 deb -libtinfo6 6.3-2ubuntu0.1 deb -libtirpc-common 1.3.2-2ubuntu0.1 deb -libtirpc3 1.3.2-2ubuntu0.1 deb -libudev1 249.11-0ubuntu3.12 deb -libunistring2 1.0-1 deb -libuuid1 2.37.2-4ubuntu3 deb -libxxhash0 0.8.1-1 deb -libzstd1 1.4.8+dfsg-3build1 deb -locales 2.35-0ubuntu3.6 deb -login 1:4.8.1-2ubuntu2.1 deb -logsave 1.46.5-2ubuntu1.1 deb -lsb-base 11.1.0ubuntu4 deb -mawk 1.3.4.20200120-3 deb -mount 2.37.2-4ubuntu3 deb -ncurses-base 6.3-2ubuntu0.1 deb -ncurses-bin 6.3-2ubuntu0.1 deb -netcat 1.218-4ubuntu1 deb -netcat-openbsd 1.218-4ubuntu1 deb -openssl 3.0.2-0ubuntu1.14 deb -passwd 1:4.8.1-2ubuntu2.1 deb -perl-base 5.34.0-3ubuntu1.2 deb -pinentry-curses 1.1.1-1build2 deb -plexmediaserver 1.40.0.7998-c29d4c0c8 deb -procps 2:3.3.17-6ubuntu2 deb -publicsuffix 20211207.1025-1 deb -readline-common 8.1.2-1 deb -sed 4.8-1ubuntu2 deb -sensible-utils 0.0.17 deb -systemd-hwe-hwdb 249.11.5 deb -sysvinit-utils 3.01-1ubuntu1 deb -tar 1.34+dfsg-1ubuntu0.1.22.04.1 deb -tzdata 2023d-0ubuntu0.22.04 deb -ubuntu-keyring 2021.03.26 deb -udev 249.11-0ubuntu3.12 deb -usrmerge 25ubuntu2 deb -util-linux 2.37.2-4ubuntu3 deb -wget 1.21.2-2ubuntu1 deb -zlib1g 1:1.2.11.dfsg-2ubuntu9.2 deb +NAME VERSION TYPE +adduser 3.118ubuntu5 deb +apt 2.4.11 deb +apt-utils 2.4.11 deb +base-files 12ubuntu4.3 deb +base-passwd 3.5.52build1 deb +bash 5.1-6ubuntu1 deb +bash 5.1.16 binary +bsdutils 1:2.37.2-4ubuntu3 deb +ca-certificates 20230311ubuntu0.22.04.1 deb +coreutils 8.32-4.1ubuntu1 deb +cron 3.0pl1-137ubuntu3 deb +curl 7.81.0-1ubuntu1.15 deb +dash 0.5.11+git20210903+057cd650a4ed-3build1 deb +debconf 1.5.79ubuntu1 deb +debianutils 5.5-1ubuntu2 deb +diffutils 1:3.8-0ubuntu2 deb +dirmngr 2.2.27-3ubuntu2.1 deb +dpkg 1.21.1ubuntu2.2 deb +e2fsprogs 1.46.5-2ubuntu1.1 deb +findutils 4.8.0-1ubuntu3 deb +gcc-12-base 12.1.0-2ubuntu1~22.04 deb +gnupg 2.2.27-3ubuntu2.1 deb +gnupg-l10n 2.2.27-3ubuntu2.1 deb +gnupg-utils 2.2.27-3ubuntu2.1 deb +gpg 2.2.27-3ubuntu2.1 deb +gpg-agent 2.2.27-3ubuntu2.1 deb +gpg-wks-client 2.2.27-3ubuntu2.1 deb +gpg-wks-server 2.2.27-3ubuntu2.1 deb +gpgconf 2.2.27-3ubuntu2.1 deb +gpgsm 2.2.27-3ubuntu2.1 deb +gpgv 2.2.27-3ubuntu2.1 deb +grep 3.7-1build1 deb +gzip 1.10-4ubuntu4.1 deb +hostname 3.23ubuntu2 deb +init-system-helpers 1.62 deb +jq 1.6-2.1ubuntu3 deb +libacl1 2.3.1-1 deb +libapt-pkg6.0 2.4.11 deb +libassuan0 2.5.5-1build1 deb +libattr1 1:2.5.1-1build1 deb +libaudit-common 1:3.0.7-1build1 deb +libaudit1 1:3.0.7-1build1 deb +libblkid1 2.37.2-4ubuntu3 deb +libbrotli1 1.0.9-2build6 deb +libbsd0 0.11.5-1 deb +libbz2-1.0 1.0.8-5build1 deb +libc-bin 2.35-0ubuntu3.1 deb +libc6 2.35-0ubuntu3.1 deb +libcap-ng0 0.7.9-2.2build3 deb +libcap2 1:2.44-1ubuntu0.22.04.1 deb +libcom-err2 1.46.5-2ubuntu1.1 deb +libcrypt1 1:4.4.27-1 deb +libcurl4 7.81.0-1ubuntu1.15 deb +libdb5.3 5.3.28+dfsg1-0.8ubuntu3 deb +libdebconfclient0 0.261ubuntu1 deb +libext2fs2 1.46.5-2ubuntu1.1 deb +libffi8 3.4.2-4 deb +libgcc-s1 12.1.0-2ubuntu1~22.04 deb +libgcrypt20 1.9.4-3ubuntu3 deb +libgmp10 2:6.2.1+dfsg-3ubuntu1 deb +libgnutls30 3.7.3-4ubuntu1.2 deb +libgpg-error0 1.43-3 deb +libgssapi-krb5-2 1.19.2-2ubuntu0.2 deb +libhogweed6 3.7.3-1build2 deb +libidn2-0 2.3.2-2build1 deb +libjq1 1.6-2.1ubuntu3 deb +libk5crypto3 1.19.2-2ubuntu0.2 deb +libkeyutils1 1.6.1-2ubuntu3 deb +libkmod2 29-1ubuntu1 deb +libkrb5-3 1.19.2-2ubuntu0.2 deb +libkrb5support0 1.19.2-2ubuntu0.2 deb +libksba8 1.6.0-2ubuntu0.2 deb +libldap-2.5-0 2.5.16+dfsg-0ubuntu0.22.04.2 deb +libldap-common 2.5.16+dfsg-0ubuntu0.22.04.2 deb +liblz4-1 1.9.3-2build2 deb +liblzma5 5.2.5-2ubuntu1 deb +libmd0 1.0.4-1build1 deb +libmount1 2.37.2-4ubuntu3 deb +libncurses6 6.3-2ubuntu0.1 deb +libncursesw6 6.3-2ubuntu0.1 deb +libnettle8 3.7.3-1build2 deb +libnghttp2-14 1.43.0-1ubuntu0.1 deb +libnpth0 1.6-3build2 deb +libnsl2 1.3.0-2build2 deb +libonig5 6.9.7.1-2build1 deb +libp11-kit0 0.24.0-6build1 deb +libpam-modules 1.4.0-11ubuntu2.3 deb +libpam-modules-bin 1.4.0-11ubuntu2.3 deb +libpam-runtime 1.4.0-11ubuntu2.3 deb +libpam0g 1.4.0-11ubuntu2.3 deb +libpcre2-8-0 10.39-3ubuntu0.1 deb +libpcre3 2:8.39-13ubuntu0.22.04.1 deb +libprocps8 2:3.3.17-6ubuntu2 deb +libpsl5 0.21.0-1.2build2 deb +libreadline8 8.1.2-1 deb +librtmp1 2.4+20151223.gitfa8646d.1-2build4 deb +libsasl2-2 2.1.27+dfsg2-3ubuntu1.2 deb +libsasl2-modules 2.1.27+dfsg2-3ubuntu1.2 deb +libsasl2-modules-db 2.1.27+dfsg2-3ubuntu1.2 deb +libseccomp2 2.5.3-2ubuntu2 deb +libselinux1 3.3-1build2 deb +libsemanage-common 3.3-1build2 deb +libsemanage2 3.3-1build2 deb +libsepol2 3.3-1build1 deb +libsmartcols1 2.37.2-4ubuntu3 deb +libsqlite3-0 3.37.2-2ubuntu0.3 deb +libss2 1.46.5-2ubuntu1.1 deb +libssh-4 0.9.6-2ubuntu0.22.04.3 deb +libssl3 3.0.2-0ubuntu1.10 deb +libstdc++6 12.1.0-2ubuntu1~22.04 deb +libsystemd0 249.11-0ubuntu3.9 deb +libtasn1-6 4.18.0-4build1 deb +libtinfo6 6.3-2ubuntu0.1 deb +libtirpc-common 1.3.2-2ubuntu0.1 deb +libtirpc3 1.3.2-2ubuntu0.1 deb +libudev1 249.11-0ubuntu3.12 deb +libunistring2 1.0-1 deb +libuuid1 2.37.2-4ubuntu3 deb +libxxhash0 0.8.1-1 deb +libzstd1 1.4.8+dfsg-3build1 deb +locales 2.35-0ubuntu3.6 deb +login 1:4.8.1-2ubuntu2.1 deb +logsave 1.46.5-2ubuntu1.1 deb +lsb-base 11.1.0ubuntu4 deb +mawk 1.3.4.20200120-3 deb +mount 2.37.2-4ubuntu3 deb +ncurses-base 6.3-2ubuntu0.1 deb +ncurses-bin 6.3-2ubuntu0.1 deb +netcat 1.218-4ubuntu1 deb +netcat-openbsd 1.218-4ubuntu1 deb +openssl 3.0.2-0ubuntu1.15 deb +passwd 1:4.8.1-2ubuntu2.1 deb +perl-base 5.34.0-3ubuntu1.2 deb +pinentry-curses 1.1.1-1build2 deb +plexmediaserver 1.40.0.7998-c29d4c0c8 deb +procps 2:3.3.17-6ubuntu2 deb +publicsuffix 20211207.1025-1 deb +readline-common 8.1.2-1 deb +sed 4.8-1ubuntu2 deb +sensible-utils 0.0.17 deb +systemd-hwe-hwdb 249.11.5 deb +sysvinit-utils 3.01-1ubuntu1 deb +tar 1.34+dfsg-1ubuntu0.1.22.04.1 deb +tzdata 2023d-0ubuntu0.22.04 deb +ubuntu-keyring 2021.03.26 deb +udev 249.11-0ubuntu3.12 deb +usrmerge 25ubuntu2 deb +util-linux 2.37.2-4ubuntu3 deb +wget 1.21.2-2ubuntu1 deb +zlib1g 1:1.2.11.dfsg-2ubuntu9.2 deb From 90e8122203c59b36659f12e4b57535a246bba0d6 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Mon, 11 Mar 2024 09:19:18 +0000 Subject: [PATCH 20/22] Bot Updating Package Versions --- package_versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_versions.txt b/package_versions.txt index 27e1cb2..8461be4 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -142,7 +142,7 @@ sensible-utils 0.0.17 deb systemd-hwe-hwdb 249.11.5 deb sysvinit-utils 3.01-1ubuntu1 deb tar 1.34+dfsg-1ubuntu0.1.22.04.1 deb -tzdata 2023d-0ubuntu0.22.04 deb +tzdata 2024a-0ubuntu0.22.04 deb ubuntu-keyring 2021.03.26 deb udev 249.11-0ubuntu3.12 deb usrmerge 25ubuntu2 deb From fdf0d7700aca4c47ce972a9fcf41a8f7a4f05d97 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Thu, 14 Mar 2024 21:22:19 +0000 Subject: [PATCH 21/22] Bot Updating Templated Files --- Jenkinsfile | 61 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5ca3a68..5d7a8d5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -270,8 +270,15 @@ pipeline { set -e TEMPDIR=$(mktemp -d) docker pull ghcr.io/linuxserver/jenkins-builder:latest - docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest - # Stage 1 - Jenkinsfile update + # Cloned repo paths for templating: + # ${TEMPDIR}/docker-${CONTAINER_NAME}: Cloned branch master of ${LS_USER}/${LS_REPO} for running the jenkins builder on + # ${TEMPDIR}/repo/${LS_REPO}: Cloned branch master of ${LS_USER}/${LS_REPO} for commiting various templated file changes and pushing back to Github + # ${TEMPDIR}/docs/docker-documentation: Cloned docs repo for pushing docs updates to Github + # ${TEMPDIR}/unraid/docker-templates: Cloned docker-templates repo to check for logos + # ${TEMPDIR}/unraid/templates: Cloned templates repo for commiting unraid template changes and pushing back to Github + git clone --branch master --depth 1 https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/docker-${CONTAINER_NAME} + docker run --rm -v ${TEMPDIR}/docker-${CONTAINER_NAME}:/tmp -e LOCAL=true ghcr.io/linuxserver/jenkins-builder:latest + echo "Starting Stage 1 - Jenkinsfile update" if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then mkdir -p ${TEMPDIR}/repo git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} @@ -283,13 +290,13 @@ pipeline { git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} - echo "Updating Jenkinsfile" + echo "Updating Jenkinsfile and exiting build, new one will trigger based on commit" rm -Rf ${TEMPDIR} exit 0 else echo "Jenkinsfile is up to date." fi - # Stage 2 - Delete old templates + echo "Starting Stage 2 - Delete old templates" OLD_TEMPLATES=".github/ISSUE_TEMPLATE.md .github/ISSUE_TEMPLATE/issue.bug.md .github/ISSUE_TEMPLATE/issue.feature.md .github/workflows/call_invalid_helper.yml .github/workflows/stale.yml Dockerfile.armhf" for i in ${OLD_TEMPLATES}; do if [[ -f "${i}" ]]; then @@ -308,13 +315,13 @@ pipeline { git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} - echo "Deleting old and deprecated templates" + echo "Deleting old/deprecated templates and exiting build, new one will trigger based on commit" rm -Rf ${TEMPDIR} exit 0 else echo "No templates to delete" fi - # Stage 3 - Update templates + echo "Starting Stage 3 - Update templates" CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) cd ${TEMPDIR}/docker-${CONTAINER_NAME} NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) @@ -338,9 +345,14 @@ pipeline { git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + echo "Updating templates and exiting build, new one will trigger based on commit" + rm -Rf ${TEMPDIR} + exit 0 else echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} + echo "No templates to update" fi + echo "Starting Stage 4 - External repo updates: Docs, Unraid Template and Readme Sync to Docker Hub" mkdir -p ${TEMPDIR}/docs git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/docs/docker-documentation if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then @@ -348,6 +360,7 @@ pipeline { cd ${TEMPDIR}/docs/docker-documentation GH_DOCS_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||') git add docs/images/docker-${CONTAINER_NAME}.md + echo "Updating docs repo" git commit -m 'Bot Updating Documentation' git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} || \ @@ -355,6 +368,8 @@ pipeline { sleep $((RANDOM % MAXWAIT)) && \ git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase && \ git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH}) + else + echo "Docs update not needed, skipping" fi mkdir -p ${TEMPDIR}/unraid git clone https://github.com/linuxserver/docker-templates.git ${TEMPDIR}/unraid/docker-templates @@ -365,6 +380,7 @@ pipeline { sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-icon.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml fi if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then + echo "Updating Unraid template" cd ${TEMPDIR}/unraid/templates/ GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||') if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then @@ -384,16 +400,27 @@ pipeline { sleep $((RANDOM % MAXWAIT)) && \ git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH} --rebase && \ git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git ${GH_TEMPLATES_DEFAULT_BRANCH}) + else + echo "No updates to Unraid template needed, skipping" fi - # Stage 4 - Sync Readme to Docker Hub if [[ "${BRANCH_NAME}" == "${GH_DEFAULT_BRANCH}" ]]; then - if [[ $(cat ${TEMPDIR}/docker-${CONTAINER_NAME}/README.md | wc -m) > 25000 ]]; then + if [[ $(cat ${TEMPDIR}/docker-${CONTAINER_NAME}/README.md | wc -m) -gt 25000 ]]; then echo "Readme is longer than 25,000 characters. Syncing the lite version to Docker Hub" DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/README.lite" else echo "Syncing readme to Docker Hub" DH_README_SYNC_PATH="${TEMPDIR}/docker-${CONTAINER_NAME}/README.md" fi + if curl -s https://hub.docker.com/v2/namespaces/${DOCKERHUB_IMAGE%%/*}/repositories/${DOCKERHUB_IMAGE##*/}/tags | jq -r '.message' | grep -q 404; then + echo "Docker Hub endpoint doesn't exist. Creating endpoint first." + DH_TOKEN=$(curl -d '{"username":"linuxserverci", "password":"'${DOCKERHUB_TOKEN}'"}' -H "Content-Type: application/json" -X POST https://hub.docker.com/v2/users/login | jq -r '.token') + curl -s \ + -H "Authorization: JWT ${DH_TOKEN}" \ + -H "Content-Type: application/json" \ + -X POST \ + -d '{"name":"'${DOCKERHUB_IMAGE##*/}'", "namespace":"'${DOCKERHUB_IMAGE%%/*}'"}' \ + https://hub.docker.com/v2/repositories/ || : + fi DH_TOKEN=$(curl -d '{"username":"linuxserverci", "password":"'${DOCKERHUB_TOKEN}'"}' -H "Content-Type: application/json" -X POST https://hub.docker.com/v2/users/login | jq -r '.token') curl -s \ -H "Authorization: JWT ${DH_TOKEN}" \ @@ -458,14 +485,16 @@ pipeline { } steps{ sh '''curl -H "Content-Type: application/json" -H "Private-Token: ${GITLAB_TOKEN}" -X POST https://gitlab.com/api/v4/projects \ - -d '{"namespace_id":'${GITLAB_NAMESPACE}',\ - "name":"'${LS_REPO}'", - "mirror":true,\ - "import_url":"https://github.com/linuxserver/'${LS_REPO}'.git",\ - "issues_access_level":"disabled",\ - "merge_requests_access_level":"disabled",\ - "repository_access_level":"enabled",\ - "visibility":"public"}' ''' + -d '{"namespace_id":'${GITLAB_NAMESPACE}',\ + "name":"'${LS_REPO}'", + "mirror":true,\ + "import_url":"https://github.com/linuxserver/'${LS_REPO}'.git",\ + "issues_access_level":"disabled",\ + "merge_requests_access_level":"disabled",\ + "repository_access_level":"enabled",\ + "visibility":"public"}' ''' + sh '''curl -H "Private-Token: ${GITLAB_TOKEN}" -X PUT "https://gitlab.com/api/v4/projects/Linuxserver.io%2F${LS_REPO}" \ + -d "mirror=true&import_url=https://github.com/linuxserver/${LS_REPO}.git" ''' } } /* ############### From 31b4fbb6b7cbe3131becb1ededbb6f1e5d1d98bc Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Thu, 14 Mar 2024 21:25:28 +0000 Subject: [PATCH 22/22] Bot Updating Package Versions --- package_versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_versions.txt b/package_versions.txt index 8461be4..26200ae 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -133,7 +133,7 @@ openssl 3.0.2-0ubuntu1.15 deb passwd 1:4.8.1-2ubuntu2.1 deb perl-base 5.34.0-3ubuntu1.2 deb pinentry-curses 1.1.1-1build2 deb -plexmediaserver 1.40.0.7998-c29d4c0c8 deb +plexmediaserver 1.40.1.8227-c0dd5a73e deb procps 2:3.3.17-6ubuntu2 deb publicsuffix 20211207.1025-1 deb readline-common 8.1.2-1 deb