docker/scripts/upgrade
2020-10-21 22:14:08 +02:00

46 lines
1019 B
Bash
Executable File

#!/bin/bash
set -e
cd $(dirname $0)/..
if [ -z $RESTARTED ]
then
echo "# pull newest bigblugbutton-docker.git"
git pull
# restart script, since it might have changed.
RESTARTED=1 ./scripts/upgrade
else
# update changed environment variable
sed -i 's/EXTERNAL_IP=/EXTERNAL_IPv4=/' .env
echo ""
echo "# pull newest git submodules"
git submodule init
git submodule update
echo ""
echo "# pull newest images"
./scripts/compose pull
echo ""
echo "# rebuild images"
# rebuild everything which got modified
./scripts/compose build --pull
COMMIT_HASH=$(git rev-parse --short HEAD)
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
echo ""
echo "-------------------------------------"
echo "images successfully rebuilt!"
echo "we are on $COMMIT_HASH ($BRANCH_NAME)"
echo ""
echo "use following command for restarting:"
echo " $ ./scripts/compose up -d"
echo "-------------------------------------"
fi