Move to commit to upgrade system

This commit is contained in:
Adam Dodman 2018-07-08 14:30:52 +01:00
parent 316c9be5f4
commit 916ae6f3b7
Signed by: AdamAnt
GPG Key ID: 7826B108895B86AA
2 changed files with 15 additions and 29 deletions

View File

@ -1,30 +1,21 @@
pipeline:
identify:
image: docker
commands:
# Grab the current version, prevents race conditions
- apk add --no-cache openssl jq
- wget -qO- https://spritsail.io/plex/release.php | tee .plex_release
- jq -r '.["url-deb"]' .plex_release > .plex_url
- jq -r '.["version"]' .plex_release > .plex_version
- jq -r '.["csum-deb"]' .plex_release > .plex_checksum
- jq -r '.["version"]' .plex_release | cut -d- -f1 > .plex_tag
build:
image: spritsail/docker-build
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
repo: plex-dev
build_args:
- 'PLEX_URL=%file: .plex_url'
- 'PLEX_VER=%file: .plex_version'
- 'PLEX_SHA=%file: .plex_checksum'
tag:
image: docker
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
commands:
- docker inspect -f '{{ index .Config.Labels "io.spritsail.version.plex" }}' plex-dev | cut -d- -f1 > .plex_tag
test:
image: docker
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
commands:
- apk add --no-cache curl xmlstarlet grep
- export CUR_VERSION="$(cat .plex_version)"
- export CUR_VERSION="$(cat .plex_tag)"
- CON_NAME=$(docker run --rm -d plex-dev)
- timeout -t 15 docker logs $$CON_NAME &
- sleep 10 # Wait for plex to start!

View File

@ -1,8 +1,7 @@
FROM spritsail/libressl
ARG PLEX_VER=latest
ARG PLEX_URL
ARG PLEX_SHA
ARG PLEX_VER=1.13.2.5154-fd05be322
ARG PLEX_SHA=81ff7f8d80ac46ca663a54e09667ad47a2ccb1cd
ARG LIBSTDCPP_VER=6.3.0-18+deb9u1
ARG LIBGCC1_VER=6.3.0-18+deb9u1
@ -10,8 +9,11 @@ LABEL maintainer="Spritsail <plex@spritsail.io>" \
org.label-schema.vendor="Spritsail" \
org.label-schema.name="Plex Media Server" \
org.label-schema.url="https://www.plex.tv/downloads/" \
org.label-schema.description="Tiny Docker image for Plex Media Server, built on spritsail/busybox" \
org.label-schema.version=$PLEX_VER
org.label-schema.description="Tiny Docker image for Plex Media Server, built on busybox" \
org.label-schema.version=${PLEX_VER} \
io.spritsail.version.plex=${PLEX_VER} \
io.spritsail.version.libstdcpp=${LIBSTDCPP_VER} \
io.spritsail.version.libgcc1=${LIBGCC1_VER}
ENV SUID=900 SGID=900
ADD start_pms /usr/sbin/start_pms
@ -26,16 +28,9 @@ RUN chmod +x /usr/sbin/start_pms \
# We only need the lib files, everything else is debian junk.
&& mv $PWD/usr/lib/x86_64-linux-gnu/* /lib \
&& mv $PWD/lib/x86_64-linux-gnu/* /lib \
\
&& if [ "$PLEX_VER" == "latest" -o -z "$PLEX_URL" ]; then \
export PLEX_VER="$(wget -qO- https://spritsail.io/plex/release.php?raw=version)"; \
export PLEX_URL="$(wget -qO- https://spritsail.io/plex/release.php?raw=url-deb)"; \
export PLEX_SHA="$(wget -qO- https://spritsail.io/plex/release.php?raw=csum-deb)"; \
fi \
&& echo "$PLEX_SHA plexmediaserver.deb" > sumfile \
&& wget -O plexmediaserver.deb "$PLEX_URL" \
&& wget -O plexmediaserver.deb https://downloads.plex.tv/plex-media-server/${PLEX_VER}/plexmediaserver_${PLEX_VER}_amd64.deb \
&& sha1sum -c sumfile \
\
&& dpkg-deb -x plexmediaserver.deb . \
&& mv usr/lib/plexmediaserver /usr/lib \
&& find $PWD -mindepth 1 -delete