This might, or might not be of use to anyone else, however, I wrote a very basic bash script to git pull from my
repo and then restart the home-assistant docker.
Hopefully, it may help someone
#!/bin/sh
git fetch
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM")
BASE=$(git merge-base @ "$UPSTREAM")
if [ $LOCAL = $REMOTE ]; then
echo "Up-to-date"
elif [ $LOCAL = $BASE ]; then
git pull && docker restart home-assistant
elif [ $REMOTE = $BASE ]; then
echo "Need to push"
else
echo "Diverged"
fi
Run this as a cron job are you’ve got a self-updating home assistant entity. Perfect for those lunchtime code amends.
Jack