scripts for publishing and upgrading images

This commit is contained in:
chandi 2022-05-08 20:40:34 +02:00
parent 9e9fff92c6
commit e2fb894f24
3 changed files with 103 additions and 14 deletions

51
scripts/publish Executable file
View File

@ -0,0 +1,51 @@
#!/bin/bash
set -e
cd "$(dirname "$0")/.."
# load .env
if [ -f .env ]
then
# exclude WELCOME_MESSAGE && WELCOME_FOOTER && CLIENT_TITLE because it may contain invalid characters
export $(cat .env | sed 's/#.*//g' | grep -v "WELCOME_FOOTER" | grep -v "WELCOME_MESSAGE" | grep -v "CLIENT_TITLE" | xargs)
fi
if [ -z "$ENABLE_WEBHOOKS" ]; then
echo "ERROR: ENABLE_WEBHOOKS must be set to true, otherwise the image would not be built"
exit 1
fi
if [ -z "$ENABLE_RECORDING" ]; then
echo "ERROR: ENABLE_RECORDING must be set to true, otherwise the image would not be built"
exit 1
fi
# generate compose file
./scripts/generate-compose
# ensure submodules are matching tags.env
./scripts/checkout-submodules
# build and push java base image
docker build -t alangecker/bbb-docker-base-java:latest mod/base-java
# buld and push other images
docker-compose build
# push images
docker push alangecker/bbb-docker-base-java:latest
docker-compose push \
html5-backend-1 \
bbb-web \
freeswitch \
apps-akka \
bbb-pads \
etherpad \
fsesl-akka \
jodconverter \
nginx \
periodic \
recordings \
webhooks \
webrtc-sfu

17
scripts/upgrade Executable file → Normal file
View File

@ -15,11 +15,6 @@ then
else
echo ""
echo "# pull newest git submodules"
git submodule init
git submodule update
echo ""
echo "# recreate docker-compose.yml"
./scripts/generate-compose
@ -27,20 +22,14 @@ else
echo ""
echo "# pull newest images"
docker-compose pull --ignore-pull-failures
echo ""
echo "# rebuild images"
docker build -t bbb-docker-base-java mod/base-java
# rebuild everything which got modified
docker-compose build
COMMIT_HASH=$(git rev-parse --short HEAD)
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
echo ""
echo "-------------------------------------"
echo "images successfully rebuilt!"
echo "update is ready!"
echo "we are on $COMMIT_HASH ($BRANCH_NAME)"
echo ""
echo "use following command for restarting bbb:"

49
scripts/upgrade-and-build Executable file
View File

@ -0,0 +1,49 @@
#!/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-and-build
exit
else
echo ""
echo "# pull newest git submodules"
git submodule init
git submodule update
echo ""
echo "# recreate docker-compose.yml"
./scripts/generate-compose
echo ""
echo "# pull newest images"
docker-compose pull --ignore-pull-failures
echo ""
echo "# rebuild images"
docker build -t alangecker/bbb-docker-base-java:latest mod/base-java
# rebuild everything which got modified
docker-compose build
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 bbb:"
echo " $ docker-compose up -d"
echo "-------------------------------------"
fi