Add updateinvidious script

This commit is contained in:
Rob Watson 2021-04-05 10:18:13 +02:00
parent 1dfe2888ff
commit 7685b52093
1 changed files with 27 additions and 0 deletions

27
script/updateinvidious Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
#
# Build and push Invidious
#
# TODO: remove Docker hub, push with SSH.
set -e
destdir=$HOME/dev/invidious
image=netfluxio/invidious:latest
remotehost=netflux
if [ ! -d $destdir ]; then
echo "Cloning invidious..."
cd $HOME/dev
git clone -q --depth=1 https://github.com/iv-org/invidious.git invidious
else
echo "Updating invidious..."
cd $destdir
git pull -q --rebase
fi
cd $destdir
docker build -t $image -f docker/Dockerfile .
docker push $image
ssh $remotehost 'cd dev/netflux-internals && docker-compose pull invidious && docker-compose up -d --force-recreate --no-deps invidious'