3.11.6 #1
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
FROM harbor.ervine.dev/library/x86_64/alpine/alpine-3.11
|
||||||
|
MAINTAINER “Jonathan Ervine” <docker@ervine.org>
|
||||||
|
|
||||||
|
ENV GETIPLAYER_OUTPUT=/config GETIPLAYER_PROFILE=/config/.get_iplayer PUID=1000 PGID=100 PORT=1935
|
||||||
|
EXPOSE 1935
|
||||||
|
VOLUME /config
|
||||||
|
|
||||||
|
RUN apk --update --no-cache add ffmpeg perl-cgi perl-mojolicious perl-lwp-protocol-https perl-xml-libxml jq logrotate su-exec tini
|
||||||
|
|
||||||
|
RUN wget -qnd "https://bitbucket.org/shield007/atomicparsley/raw/68337c0c05ec4ba2ad47012303121aaede25e6df/downloads/build_linux_x86_64/AtomicParsley" && \
|
||||||
|
install -m 755 -t /usr/local/bin ./AtomicParsley && \
|
||||||
|
rm ./AtomicParsley
|
||||||
|
|
||||||
|
RUN wget -qO - "https://api.github.com/repos/get-iplayer/get_iplayer/releases/latest" > /tmp/latest.json && \
|
||||||
|
echo get_iplayer release `jq -r .name /tmp/latest.json` && \
|
||||||
|
wget -qO - "`jq -r .tarball_url /tmp/latest.json`" | tar -zxf - && \
|
||||||
|
cd get-iplayer* && \
|
||||||
|
install -m 755 -t /usr/local/bin ./get_iplayer ./get_iplayer.cgi && \
|
||||||
|
cd / && \
|
||||||
|
rm -rf get-iplayer* && \
|
||||||
|
rm /tmp/latest.json
|
||||||
|
|
||||||
|
COPY files/ /
|
||||||
|
|
||||||
|
ENTRYPOINT ["/sbin/tini", "--"]
|
||||||
|
CMD /start
|
||||||
18
Jenkinsfile
vendored
Normal file
18
Jenkinsfile
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
node("docker-node") {
|
||||||
|
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
|
||||||
|
|
||||||
|
git branch: "3.11.6", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine-get_iplayer", credentialsId: 'jenkins-to-git'
|
||||||
|
|
||||||
|
sh "git rev-parse HEAD > .git/commit-id"
|
||||||
|
def commit_id = readFile('.git/commit-id').trim()
|
||||||
|
println commit_id
|
||||||
|
|
||||||
|
stage "build"
|
||||||
|
def app = docker.build "library/x86_64/alpine/get_iplayer"
|
||||||
|
|
||||||
|
stage "publish"
|
||||||
|
app.push("${env.BUILD_NUMBER}")
|
||||||
|
app.push("3.25")
|
||||||
|
app.push("latest")
|
||||||
|
}
|
||||||
|
}
|
||||||
5
files/etc/crontabs/root
Normal file
5
files/etc/crontabs/root
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
# min hour day month weekday command
|
||||||
|
0 * * * * run-parts /etc/periodic/hourly
|
||||||
|
0 2 * * * run-parts /etc/periodic/daily
|
||||||
|
|
||||||
8
files/etc/logrotate.d/get_iplayer
Normal file
8
files/etc/logrotate.d/get_iplayer
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/var/log/get_iplayer*.log {
|
||||||
|
notifempty
|
||||||
|
weekly
|
||||||
|
rotate 4
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
missingok
|
||||||
|
}
|
||||||
12
files/etc/periodic/daily/get_iplayer_update
Normal file
12
files/etc/periodic/daily/get_iplayer_update
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Check for get_iplayer update.
|
||||||
|
# When updating will kill any active downloads launched from web front-end, but not those launched by hourly background PVR.
|
||||||
|
#
|
||||||
|
(
|
||||||
|
OLD=`get_iplayer -V 2>&1 | sed -nE 's/get_iplayer v(\d+)\.(\d+).*/\1\2/p'` # e.g. 321
|
||||||
|
wget -qO - "https://api.github.com/repos/get-iplayer/get_iplayer/releases/latest" > /tmp/latest.json
|
||||||
|
NEW=`jq -r .name /tmp/latest.json | sed -nE 's/v(\d+)\.(\d+).*/\1\2/p'` # e.g. 322
|
||||||
|
[ ! -z "$OLD" ] && [ ! -z "$NEW" ] && [ $OLD -lt $NEW ] && echo "Updating get_iplayer $OLD -> $NEW" 1>&2 && wget -qO - "`jq -r .tarball_url /tmp/latest.json`" | tar -zxf - && cd get-iplayer* && install -m 755 -t /usr/local/bin ./get_iplayer ./get_iplayer.cgi && cd $OLDPWD && rm -rf get-iplayer* && PID=`ps | grep "/usr/local/bin/get_iplayer.cgi" | grep -v grep | cut -c1-6` && [ ! -z "$PID" ] && kill $PID
|
||||||
|
) 2>> /var/log/get_iplayer_update.log
|
||||||
|
rm -f /tmp/latest.json
|
||||||
6
files/etc/periodic/hourly/get_iplayer_pvr
Normal file
6
files/etc/periodic/hourly/get_iplayer_pvr
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Run pvr
|
||||||
|
#
|
||||||
|
umask 2
|
||||||
|
su-exec $PUID:$PGID /usr/local/bin/get_iplayer --pvr --quiet 2>> /var/log/get_iplayer.log
|
||||||
18
files/start
Executable file
18
files/start
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Docker entrypoint
|
||||||
|
#
|
||||||
|
|
||||||
|
# Ensure up-to-date
|
||||||
|
/etc/periodic/daily/get_iplayer_update
|
||||||
|
|
||||||
|
# Start cron with output to syslog
|
||||||
|
/sbin/syslogd
|
||||||
|
/usr/sbin/crond
|
||||||
|
|
||||||
|
# Restart if killed, e.g. due to update
|
||||||
|
umask 2
|
||||||
|
while true; do
|
||||||
|
/usr/local/bin/get_iplayer -V
|
||||||
|
su-exec $PUID:$PGID /usr/local/bin/get_iplayer.cgi -p $PORT
|
||||||
|
done
|
||||||
Loading…
Reference in New Issue
Block a user