diff --git a/Dockerfile b/Dockerfile index 1e70dda..f517be5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,32 +24,43 @@ RUN \ echo "deb http://ppa.launchpad.net/jcfp/sab-addons/ubuntu bionic main" >> /etc/apt/sources.list.d/sabnzbd.list && \ echo "deb-src http://ppa.launchpad.net/jcfp/sab-addons/ubuntu bionic main" >> /etc/apt/sources.list.d/sabnzbd.list && \ echo "**** install packages ****" && \ - if [ -z ${SABNZBD_VERSION+x} ]; then \ - SABNZBD="sabnzbdplus"; \ - else \ - SABNZBD_CLEAN=$(echo "${SABNZBD_VERSION}"| sed 's/..$//') && \ - SABNZBD="sabnzbdplus=${SABNZBD_CLEAN}"; \ - fi && \ apt-get update && \ apt-get install -y \ + jq \ + libffi-dev \ + libssl-dev \ p7zip-full \ par2-tbb \ python3 \ + python3-cryptography \ + python3-distutils \ python3-pip \ - ${SABNZBD} \ - unrar \ - unzip && \ - pip3 install --no-cache-dir \ + unrar && \ + if [ -z ${SABNZBD_VERSION+x} ]; then \ + SABNZBD_VERSION=$(curl -s https://api.github.com/repos/sabnzbd/sabnzbd/releases \ + | jq -r 'first(.[]) | .tag_name'); \ + fi && \ + mkdir -p /app/sabnzbd && \ + curl -o \ + /tmp/sabnzbd.tar.gz -L \ + "https://github.com/sabnzbd/sabnzbd/releases/download/${SABNZBD_VERSION}/SABnzbd-${SABNZBD_VERSION}-src.tar.gz" && \ + tar xf \ + /tmp/sabnzbd.tar.gz -C \ + /app/sabnzbd --strip-components=1 && \ + cd /app/sabnzbd && \ + pip3 install -U pip && \ + pip install -U --no-cache-dir \ apprise \ - chardet \ pynzb \ - requests \ - sabyenc && \ + requests && \ + pip install -U --no-cache-dir -r requirements.txt && \ echo "**** cleanup ****" && \ ln -s \ /usr/bin/python3 \ /usr/bin/python && \ apt-get purge --auto-remove -y \ + libffi-dev \ + libssl-dev \ python3-pip && \ apt-get clean && \ rm -rf \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 6356525..58a5217 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -24,32 +24,43 @@ RUN \ echo "deb http://ppa.launchpad.net/jcfp/sab-addons/ubuntu bionic main" >> /etc/apt/sources.list.d/sabnzbd.list && \ echo "deb-src http://ppa.launchpad.net/jcfp/sab-addons/ubuntu bionic main" >> /etc/apt/sources.list.d/sabnzbd.list && \ echo "**** install packages ****" && \ - if [ -z ${SABNZBD_VERSION+x} ]; then \ - SABNZBD="sabnzbdplus"; \ - else \ - SABNZBD_CLEAN=$(echo "${SABNZBD_VERSION}"| sed 's/..$//') && \ - SABNZBD="sabnzbdplus=${SABNZBD_CLEAN}"; \ - fi && \ apt-get update && \ apt-get install -y \ + jq \ + libffi-dev \ + libssl-dev \ p7zip-full \ par2-tbb \ python3 \ + python3-cryptography \ + python3-distutils \ python3-pip \ - ${SABNZBD} \ - unrar \ - unzip && \ - pip3 install --no-cache-dir \ + unrar && \ + if [ -z ${SABNZBD_VERSION+x} ]; then \ + SABNZBD_VERSION=$(curl -s https://api.github.com/repos/sabnzbd/sabnzbd/releases \ + | jq -r 'first(.[]) | .tag_name'); \ + fi && \ + mkdir -p /app/sabnzbd && \ + curl -o \ + /tmp/sabnzbd.tar.gz -L \ + "https://github.com/sabnzbd/sabnzbd/releases/download/${SABNZBD_VERSION}/SABnzbd-${SABNZBD_VERSION}-src.tar.gz" && \ + tar xf \ + /tmp/sabnzbd.tar.gz -C \ + /app/sabnzbd --strip-components=1 && \ + cd /app/sabnzbd && \ + pip3 install -U pip && \ + pip install -U --no-cache-dir \ apprise \ - chardet \ pynzb \ - requests \ - sabyenc && \ + requests && \ + pip install -U --no-cache-dir -r requirements.txt && \ echo "**** cleanup ****" && \ ln -s \ /usr/bin/python3 \ /usr/bin/python && \ apt-get purge --auto-remove -y \ + libffi-dev \ + libssl-dev \ python3-pip && \ apt-get clean && \ rm -rf \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 28fe918..01aebd0 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -24,32 +24,43 @@ RUN \ echo "deb http://ppa.launchpad.net/jcfp/sab-addons/ubuntu bionic main" >> /etc/apt/sources.list.d/sabnzbd.list && \ echo "deb-src http://ppa.launchpad.net/jcfp/sab-addons/ubuntu bionic main" >> /etc/apt/sources.list.d/sabnzbd.list && \ echo "**** install packages ****" && \ - if [ -z ${SABNZBD_VERSION+x} ]; then \ - SABNZBD="sabnzbdplus"; \ - else \ - SABNZBD_CLEAN=$(echo "${SABNZBD_VERSION}"| sed 's/..$//') && \ - SABNZBD="sabnzbdplus=${SABNZBD_CLEAN}"; \ - fi && \ apt-get update && \ apt-get install -y \ + jq \ + libffi-dev \ + libssl-dev \ p7zip-full \ par2-tbb \ python3 \ + python3-cryptography \ + python3-distutils \ python3-pip \ - ${SABNZBD} \ - unrar \ - unzip && \ - pip3 install --no-cache-dir \ + unrar && \ + if [ -z ${SABNZBD_VERSION+x} ]; then \ + SABNZBD_VERSION=$(curl -s https://api.github.com/repos/sabnzbd/sabnzbd/releases \ + | jq -r 'first(.[]) | .tag_name'); \ + fi && \ + mkdir -p /app/sabnzbd && \ + curl -o \ + /tmp/sabnzbd.tar.gz -L \ + "https://github.com/sabnzbd/sabnzbd/releases/download/${SABNZBD_VERSION}/SABnzbd-${SABNZBD_VERSION}-src.tar.gz" && \ + tar xf \ + /tmp/sabnzbd.tar.gz -C \ + /app/sabnzbd --strip-components=1 && \ + cd /app/sabnzbd && \ + pip3 install -U pip && \ + pip install -U --no-cache-dir \ apprise \ - chardet \ pynzb \ - requests \ - sabyenc && \ + requests && \ + pip install -U --no-cache-dir -r requirements.txt && \ echo "**** cleanup ****" && \ ln -s \ /usr/bin/python3 \ /usr/bin/python && \ apt-get purge --auto-remove -y \ + libffi-dev \ + libssl-dev \ python3-pip && \ apt-get clean && \ rm -rf \ diff --git a/Jenkinsfile b/Jenkinsfile index c1c317d..6c64ea0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,7 +103,7 @@ pipeline { steps{ script{ env.EXT_RELEASE = sh( - script: ''' curl -sX GET http://ppa.launchpad.net/jcfp/ppa/ubuntu/dists/bionic/main/binary-amd64/Packages.gz | gunzip |grep -A 7 -m 1 'Package: sabnzbdplus' | awk -F ': ' '/Version/{print $2;exit}' | sed 's/$/-u/' ''', + script: ''' curl -s https://api.github.com/repos/sabnzbd/sabnzbd/releases | jq -r 'first(.[]) | .tag_name' ''', returnStdout: true).trim() env.RELEASE_LINK = 'custom_command' } diff --git a/README.md b/README.md index a3558c4..0c87cc4 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **17.08.20:** - Switch to running from source with python3 instead of ppa. * **08.05.20:** - Switch to `ppa:jcfp/ppa`. * **03.01.20:** - Use alpha head for unstable with Python3. * **23.03.19:** - Switching to new Base images, shift to arm32v7 tag. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 1e4f9be..87a6887 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -3,7 +3,7 @@ # jenkins variables project_name: docker-sabnzbd external_type: na -custom_version_command: "curl -sX GET http://ppa.launchpad.net/jcfp/ppa/ubuntu/dists/bionic/main/binary-amd64/Packages.gz | gunzip |grep -A 7 -m 1 'Package: sabnzbdplus' | awk -F ': ' '/Version/{print $2;exit}' | sed 's/$/-u/'" +custom_version_command: "curl -s https://api.github.com/repos/sabnzbd/sabnzbd/releases | jq -r 'first(.[]) | .tag_name'" release_type: prerelease release_tag: unstable ls_branch: unstable diff --git a/readme-vars.yml b/readme-vars.yml index dc92fec..0474204 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -58,6 +58,7 @@ app_setup_block: | # changelog changelogs: + - { date: "17.08.20:", desc: "Switch to running from source with python3 instead of ppa." } - { date: "08.05.20:", desc: "Switch to `ppa:jcfp/ppa`." } - { date: "03.01.20:", desc: "Use alpha head for unstable with Python3." } - { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." } diff --git a/root/etc/services.d/sabnzbd/run b/root/etc/services.d/sabnzbd/run index 1a88e63..5c18516 100644 --- a/root/etc/services.d/sabnzbd/run +++ b/root/etc/services.d/sabnzbd/run @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bash exec \ - s6-setuidgid abc /usr/bin/sabnzbdplus \ + s6-setuidgid abc python3 /app/sabnzbd/SABnzbd.py \ --config-file /config --server 0.0.0.0:8080