From 29539cc5ae1446e15a7081009629eab790932110 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 8 Sep 2018 23:28:58 +0200 Subject: [PATCH] Add automated updates Signed-off-by: Knut Ahlers --- .travis.yml | 7 +++++++ update-version.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .travis.yml create mode 100755 update-version.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c1fb6e6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +sudo: required + +services: + - docker + +script: + - bash update-version.sh diff --git a/update-version.sh b/update-version.sh new file mode 100755 index 0000000..5927a4f --- /dev/null +++ b/update-version.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -euo pipefail + +### ---- ### + +echo "Switch back to master" +git checkout master +git reset --hard origin/master + +### ---- ### + +echo "Fetching latest version..." +LATEST=$(curl -sSLf 'https://lv.luzifer.io/catalog-api/radicale/latest.txt?p=version') + +echo "Found version ${LATEST}, patching..." +sed -i "s/RADICALE_VERSION=.*$/RADICALE_VERSION=${LATEST}/" Dockerfile + +echo "Checking for changes..." +git diff --exit-code && exit 0 + +echo "Testing build..." +docker build . + +echo "Updating repository..." +git add Dockerfile +git -c user.name='Travis Automated Update' -c user.email='travis@luzifer.io' \ + commit -m "Radicale ${LATEST}" +git tag ${LATEST} + +git push -q https://${GH_USER}:${GH_TOKEN}@github.com/luzifer-docker/radicale.git master --tags