diff --git a/Dockerfile b/Dockerfile index 392041b..2e5c3a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,11 +7,7 @@ MAINTAINER “Jonathan Ervine” ENV LANG='en_US.UTF-8' \ LANGUAGE='en_US.UTF-8' \ TERM='xterm' \ - VERSION='2.1.44' \ - HTPC_USER='mediaservice' \ - HTPC_GROUP='mediaservice' \ - HTPC_UID='1003' \ - HTPC_GID='1003' + VERSION='2.5.2' RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \ apk update && \ @@ -26,12 +22,10 @@ RUN wget https://github.com/Tautulli/Tautulli/archive/v$VERSION.tar.gz && \ tar zxvf v$VERSION.tar.gz -C / && \ mv /Tautulli-$VERSION /Tautulli && \ rm *.tar.gz && \ - rm -rf /var/cache/apk/* && \ - addgroup -g $HTPC_GID $HTPC_GROUP && \ - adduser -D -u $HTPC_UID -G $HTPC_GROUP -H $HTPC_USER + rm -rf /var/cache/apk/* + +COPY start.sh /usr/local/bin/start.sh EXPOSE 8181 -USER $HTPC_USER - -CMD [ "/usr/bin/python", "/Tautulli/Tautulli.py", "--datadir", "/config", "--nofork", "--nolaunch" ] +CMD [ "/usr/local/bin/start.sh" ] diff --git a/Jenkinsfile b/Jenkinsfile index 70f0750..0e4b1cd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,17 +1,28 @@ node("docker-node") { docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') { - git branch: "3.11.3", url: "ssh://git@git.ervine.org:2222/jonny/x86_64-alpine-tautulli", credentialsId: 'jenkins-to-git' + git branch: "3.11.6", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine-tautulli", credentialsId: 'jenkins-to-git' sh "git rev-parse HEAD > .git/commit-id" def commit_id = readFile('.git/commit-id').trim() println commit_id + + try { + stage "build" + def app = docker.build "library/x86_64/alpine/tautulli" - stage "build" - def app = docker.build "library/x86_64/alpine/tautulli" - - stage "publish" - app.push("${env.BUILD_NUMBER}") - app.push("latest") + stage "publish" + app.push("${env.BUILD_NUMBER}") + app.push("latest") + app.push("2.5.2") + app.push("2.5") + + stage('Deploy on k8s'){ + sh "/usr/local/bin/kubectl -n media delete po tautulli-0" + } + } + catch (err) { + currentBuild.result = 'FAILURE' + } } } diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..edd2ea3 --- /dev/null +++ b/start.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# +## Script to kick off Tautulli +# +addgroup -g $GID $USER +adduser -D -u $UID -G $USER -H $USER +chown -R $UID:$GID /Tautulli /config +su - $USER -c "/usr/bin/python /Tautulli/Tautulli.py --datadir /config --nofork --nolaunch"