From d3542c37bb3926c8cb05a8307071fd179c27d819 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Tue, 28 Jul 2020 00:08:56 +0800 Subject: [PATCH] Initial commit --- Dockerfile | 28 ++++++++++++++++++++++++++++ Jenkinsfile | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 Dockerfile create mode 100644 Jenkinsfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..547abc2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM debian:buster-slim + +LABEL maintainer="Jonathan Ervine " + +# Set ENV variables +ENV LANG='en_US.UTF-8' \ + LANGUAGE='en_US.UTF-8' \ + TERM='xterm' \ + VERSION='2.25.0' \ + HYDRA_USER='hydra' \ + HYDRA_UID='1003' \ + HYDRA_GID='1003' + +# Install updates + +RUN apt update && apt upgrade -y && \ + apt install unzip git python3 openjdk-11-jre-headless -y && \ + wget https://github.com/theotherp/nzbhydra2/releases/download/v$VERSION/nzbhydra2-$VERSION-linux.zip -O nzbhydra.zip && \ + mkdir /nzbhydra && \ + unzip /nzbhydra.zip -d /nzbhydra && \ + useradd -u $HYDRA_UID -U -M $HYDRA_USER && \ + chmod 755 /nzbhydra/nzbhydra2 + +EXPOSE 5076 +VOLUME /config +WORKDIR /nzbhydra + +CMD [ "/usr/bin/python3", "nzbhydra2wrapperPy3.py", "--nobrowser", "--datafolder=/config/" ] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..ce801d2 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,36 @@ + +podTemplate(yaml: """ +kind: Pod +spec: + containers: + - name: kaniko + image: gcr.io/kaniko-project/executor:debug-539ddefcae3fd6b411a95982a830d987f4214251 + imagePullPolicy: Always + command: + - /busybox/cat + tty: true + volumeMounts: + - name: jenkins-docker-cfg + mountPath: /kaniko/.docker + volumes: + - name: jenkins-docker-cfg + projected: + sources: + - secret: + name: regcred + items: + - key: .dockerconfigjson + path: config.json +""" + ) { + + node(POD_LABEL) { + stage('Build with Kaniko') { + git url: 'ssh://git@git.ervine.org/jonny/x86_64-debian-nzbhydra.git', credentialsId: 'jenkins-to-git' + container('kaniko') { + sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=false --destination=harbor.ervine.dev/public/x86_64/debian/nzbhydra2:v2.25.0 --destination=harbor.ervine.dev/public/x86_64/debian/nzbhydra2:v2.25' + } + } + } +} +