From 1b313bdbf34ffde109cf7990d16d01b121bf19da Mon Sep 17 00:00:00 2001 From: thelamer Date: Tue, 21 Jul 2020 07:42:55 -0700 Subject: [PATCH 1/4] ingest from repos and add web path to run --- Dockerfile | 25 ++++++++----------------- Dockerfile.aarch64 | 21 +++++++++------------ Dockerfile.armhf | 19 +++++++------------ jenkins-vars.yml | 6 ++---- root/etc/services.d/jellyfin/run | 3 ++- 5 files changed, 28 insertions(+), 46 deletions(-) diff --git a/Dockerfile b/Dockerfile index 891e5f3..82223bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,32 +12,23 @@ ARG DEBIAN_FRONTEND="noninteractive" ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" RUN \ - echo "**** install packages ****" && \ - apt-get update && \ - apt-get install -y --no-install-recommends \ - gnupg && \ - echo "**** add jellyfin deps *****" && \ + echo "**** install jellyfin *****" && \ curl -s https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | apt-key add - && \ echo 'deb [arch=amd64] https://repo.jellyfin.org/ubuntu bionic main' > /etc/apt/sources.list.d/jellyfin.list && \ + if [ -z ${JELLYFIN_RELEASE+x} ]; then \ + JELLYFIN="jellyfin"; \ + else \ + JELLYFIN="jellyfin=${JELLYFIN_RELEASE}"; \ + fi && \ apt-get update && \ apt-get install -y --no-install-recommends \ at \ i965-va-driver \ - jellyfin-ffmpeg \ + ${JELLYFIN} \ libfontconfig1 \ libfreetype6 \ - libssl1.0.0 \ + libssl1.1 \ mesa-va-drivers && \ - echo "**** install jellyfin *****" && \ - if [ -z ${JELLYFIN_RELEASE+x} ]; then \ - JELLYFIN_RELEASE=$(curl -sX GET "https://api.github.com/repos/jellyfin/jellyfin/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - VERSION=$(echo "${JELLYFIN_RELEASE}" | sed 's/^v//g') && \ - curl -o \ - /tmp/jellyfin.deb -L \ - "https://github.com/jellyfin/jellyfin/releases/download/v${VERSION}/jellyfin_${VERSION}-1_ubuntu-amd64.deb" && \ - dpkg -i /tmp/jellyfin.deb && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index d68d57a..d201412 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -16,28 +16,25 @@ RUN \ apt-get update && \ apt-get install -y --no-install-recommends \ gnupg && \ - echo "**** add jellyfin deps *****" && \ + echo "**** install jellyfin *****" && \ curl -s https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | apt-key add - && \ + curl -s https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0x6587ffd6536b8826e88a62547876ae518cbcf2f2 | apt-key add - && \ echo 'deb [arch=arm64] https://repo.jellyfin.org/ubuntu bionic main' > /etc/apt/sources.list.d/jellyfin.list && \ + echo "deb http://ppa.launchpad.net/ubuntu-raspi2/ppa/ubuntu bionic main">> /etc/apt/sources.list.d/raspbins.list && \ + if [ -z ${JELLYFIN_RELEASE+x} ]; then \ + JELLYFIN="jellyfin"; \ + else \ + JELLYFIN="jellyfin=${JELLYFIN_RELEASE}"; \ + fi && \ apt-get update && \ apt-get install -y --no-install-recommends \ at \ - jellyfin-ffmpeg \ + ${JELLYFIN} \ libfontconfig1 \ libfreetype6 \ libomxil-bellagio0 \ libomxil-bellagio-bin \ libssl1.0.0 && \ - echo "**** install jellyfin *****" && \ - if [ -z ${JELLYFIN_RELEASE+x} ]; then \ - JELLYFIN_RELEASE=$(curl -sX GET "https://api.github.com/repos/jellyfin/jellyfin/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - VERSION=$(echo "${JELLYFIN_RELEASE}" | sed 's/^v//g') && \ - curl -o \ - /tmp/jellyfin.deb -L \ - "https://github.com/jellyfin/jellyfin/releases/download/v${VERSION}/jellyfin_${VERSION}-1_ubuntu-arm64.deb" && \ - dpkg -i /tmp/jellyfin.deb && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 9523d9f..99b44d3 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -16,31 +16,26 @@ RUN \ apt-get update && \ apt-get install -y --no-install-recommends \ gnupg && \ - echo "**** add jellyfin deps *****" && \ + echo "**** install jellyfin *****" && \ curl -s https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | apt-key add - && \ curl -s https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0x6587ffd6536b8826e88a62547876ae518cbcf2f2 | apt-key add - && \ echo 'deb [arch=armhf] https://repo.jellyfin.org/ubuntu bionic main' > /etc/apt/sources.list.d/jellyfin.list && \ echo "deb http://ppa.launchpad.net/ubuntu-raspi2/ppa/ubuntu bionic main">> /etc/apt/sources.list.d/raspbins.list && \ + if [ -z ${JELLYFIN_RELEASE+x} ]; then \ + JELLYFIN="jellyfin"; \ + else \ + JELLYFIN="jellyfin=${JELLYFIN_RELEASE}"; \ + fi && \ apt-get update && \ apt-get install -y --no-install-recommends \ at \ - jellyfin-ffmpeg \ + ${JELLYFIN} \ libfontconfig1 \ libfreetype6 \ libomxil-bellagio0 \ libomxil-bellagio-bin \ libraspberrypi0 \ libssl1.0.0 && \ - echo "**** install jellyfin *****" && \ - if [ -z ${JELLYFIN_RELEASE+x} ]; then \ - JELLYFIN_RELEASE=$(curl -sX GET "https://api.github.com/repos/jellyfin/jellyfin/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - VERSION=$(echo "${JELLYFIN_RELEASE}" | sed 's/^v//g') && \ - curl -o \ - /tmp/jellyfin.deb -L \ - "https://github.com/jellyfin/jellyfin/releases/download/v${VERSION}/jellyfin_${VERSION}-1_ubuntu-armhf.deb" && \ - dpkg -i /tmp/jellyfin.deb && \ echo "**** cleanup ****" && \ rm -rf \ /tmp/* \ diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 2daed9a..3249901 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -2,14 +2,12 @@ # jenkins variables project_name: docker-jellyfin -external_type: github_stable +external_type: na +custom_version_command: "curl -sX GET https://repo.jellyfin.org/ubuntu/dists/focal/main/binary-amd64/Packages |grep -A 7 -m 1 'Package: jellyfin' | awk -F ': ' '/Version/{print $2;exit}'" release_type: stable release_tag: latest ls_branch: master repo_vars: - - EXT_GIT_BRANCH = 'master' - - EXT_USER = 'jellyfin' - - EXT_REPO = 'jellyfin' - BUILD_VERSION_ARG = 'JELLYFIN_RELEASE' - LS_USER = 'linuxserver' - LS_REPO = 'docker-jellyfin' diff --git a/root/etc/services.d/jellyfin/run b/root/etc/services.d/jellyfin/run index e369b04..b222572 100644 --- a/root/etc/services.d/jellyfin/run +++ b/root/etc/services.d/jellyfin/run @@ -11,4 +11,5 @@ umask "$UMASK_SET" exec \ s6-setuidgid abc /usr/bin/jellyfin \ - --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg + --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg \ + --webdir=/usr/share/jellyfin/web From 075f0925fd4cadf4db53761a8dda08fb9d510481 Mon Sep 17 00:00:00 2001 From: thelamer Date: Tue, 21 Jul 2020 07:43:36 -0700 Subject: [PATCH 2/4] templating --- Jenkinsfile | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 982a0af..236b646 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,9 +16,6 @@ pipeline { GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab') GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0') GITLAB_NAMESPACE=credentials('gitlab-namespace-id') - EXT_GIT_BRANCH = 'master' - EXT_USER = 'jellyfin' - EXT_REPO = 'jellyfin' BUILD_VERSION_ARG = 'JELLYFIN_RELEASE' LS_USER = 'linuxserver' LS_REPO = 'docker-jellyfin' @@ -101,23 +98,16 @@ pipeline { /* ######################## External Release Tagging ######################## */ - // If this is a stable github release use the latest endpoint from github to determine the ext tag - stage("Set ENV github_stable"){ - steps{ - script{ - env.EXT_RELEASE = sh( - script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''', - returnStdout: true).trim() - } - } - } - // If this is a stable or devel github release generate the link for the build message - stage("Set ENV github_link"){ - steps{ - script{ - env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE - } - } + // If this is a custom command to determine version use that command + stage("Set tag custom bash"){ + steps{ + script{ + env.EXT_RELEASE = sh( + script: ''' curl -sX GET https://repo.jellyfin.org/ubuntu/dists/focal/main/binary-amd64/Packages |grep -A 7 -m 1 'Package: jellyfin' | awk -F ': ' '/Version/{print $2;exit}' ''', + returnStdout: true).trim() + env.RELEASE_LINK = 'custom_command' + } + } } // Sanitize the release tag and strip illegal docker or github characters stage("Sanitize tag"){ @@ -672,11 +662,11 @@ pipeline { "tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' echo "Pushing New release for Tag" sh '''#! /bin/bash - curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json + echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ "target_commitish": "master",\ "name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ - "body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' Changes:**\\n\\n' > start + "body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Remote Changes:**\\n\\n' > start printf '","draft": false,"prerelease": false}' >> releasebody.json paste -d'\\0' start releasebody.json > releasebody.json.done curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done''' From c406a696a10994d8595dbbd371e71e95912b1bf3 Mon Sep 17 00:00:00 2001 From: thelamer Date: Tue, 21 Jul 2020 07:46:38 -0700 Subject: [PATCH 3/4] forgot pulling out gnupg when testing rebase to focal --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 82223bf..40d737a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,10 @@ ARG DEBIAN_FRONTEND="noninteractive" ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" RUN \ + echo "**** install packages ****" && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + gnupg && \ echo "**** install jellyfin *****" && \ curl -s https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | apt-key add - && \ echo 'deb [arch=amd64] https://repo.jellyfin.org/ubuntu bionic main' > /etc/apt/sources.list.d/jellyfin.list && \ From a6f6d7bde004c1dfee8bb023bcb53d647c996026 Mon Sep 17 00:00:00 2001 From: thelamer Date: Tue, 21 Jul 2020 07:47:52 -0700 Subject: [PATCH 4/4] update readme --- README.md | 1 + readme-vars.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 66c6f95..e1e83d9 100644 --- a/README.md +++ b/README.md @@ -296,6 +296,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **22.07.20:** - Ingest releases from Jellyfin repo. * **28.04.20:** - Replace MMAL/OMX dependency device `/dev/vc-mem` with `/dev/vcsm` as the former was not sufficient for raspbian. * **11.04.20:** - Enable hw decode (mmal) on Raspberry Pi, update readme instructions, add donation info, create missing default transcodes folder. * **11.03.20:** - Add Pi V4L2 support, remove optional transcode mapping (location is selected in the gui, defaults to path under `/config`). diff --git a/readme-vars.yml b/readme-vars.yml index 7f0ddd1..1a22461 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -101,6 +101,7 @@ app_setup_block: | # changelog changelogs: + - { date: "22.07.20:", desc: "Ingest releases from Jellyfin repo." } - { date: "28.04.20:", desc: "Replace MMAL/OMX dependency device `/dev/vc-mem` with `/dev/vcsm` as the former was not sufficient for raspbian." } - { date: "11.04.20:", desc: "Enable hw decode (mmal) on Raspberry Pi, update readme instructions, add donation info, create missing default transcodes folder." } - { date: "11.03.20:", desc: "Add Pi V4L2 support, remove optional transcode mapping (location is selected in the gui, defaults to path under `/config`)." }