2
0
mirror of https://github.com/spritsail/plex-media-server.git synced 2024-11-08 18:56:22 +00:00
plex-media-server/update.sh
Joe Groocock a09bf8c4ff
Bump Plex build on cron and attempt to push to git
This should cover 95% of cases where we'd want to bump Plex, but
autonomously. If the build fails or the tests fail we'll know about it
and can manually investigate.

Signed-off-by: Joe Groocock <me@frebib.net>
2021-02-16 16:08:03 +00:00

27 lines
742 B
Bash
Executable File

#!/bin/bash
set -e
RELEASE="$(curl -fsSL https://api.spritsail.io/plex/release | jq -c)"
VERSION="$(jq -r .version <<< "$RELEASE")"
CHECKSUM="$(jq -r '.["csum-deb"]' <<< "$RELEASE")"
sed -Ei \
-e "s/^(ARG PLEX_VER=).*$/\1$VERSION/" \
-e "s/^(ARG PLEX_SHA=).*$/\1$CHECKSUM/" \
Dockerfile
if ! git diff --quiet --exit-code Dockerfile; then
export GIT_COMMITTER_NAME="Spritsail Bot"
export GIT_COMMITTER_EMAIL="<bot@spritsail.io>"
export GIT_AUTHOR_NAME="$GIT_COMMITTER_NAME"
export GIT_AUTHOR_EMAIL="$GIT_COMMITTER_EMAIL"
git reset --soft
git add -- Dockerfile
git commit \
--no-gpg-sign \
--signoff \
-m "Update to Plex ${VERSION%-*}"
else
>&2 echo No update available
fi