mirror of
https://github.com/bigbluebutton/docker.git
synced 2024-12-13 02:11:21 +01:00
50 lines
1.3 KiB
Bash
Executable File
50 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
# load .env
|
|
if [ -f .env ]
|
|
then
|
|
export $(cat .env | sed 's/#.*//g' | grep -E "RAILS_SECRET|POSTGRESQL_SECRET" | xargs)
|
|
fi
|
|
|
|
COMPOSE_PREFIX=$(docker compose ps | grep postgres | awk '{print $1}' | sed 's/-postgres-1//')
|
|
|
|
docker kill -s SIGKILL greenlight-v2-tmp 2>/dev/null
|
|
sleep 1
|
|
|
|
echo "temporarily starting old greenlight v2..."
|
|
docker run \
|
|
--rm \
|
|
--detach --name greenlight-v2-tmp \
|
|
--network ${COMPOSE_PREFIX}_bbb-net \
|
|
--env-file .env \
|
|
-e DB_ADAPTER=postgresql \
|
|
-e DB_HOST=10.7.7.22 \
|
|
-e DB_NAME=greenlight \
|
|
-e DB_USERNAME=postgres \
|
|
-e DB_PASSWORD=${POSTGRESQL_SECRET:-password} \
|
|
-e SECRET_KEY_BASE=${RAILS_SECRET} \
|
|
-e V3_ENDPOINT="http://10.7.7.21:3000" \
|
|
-e V3_SECRET_KEY_BASE=${RAILS_SECRET} \
|
|
bigbluebutton/greenlight:v2.14
|
|
|
|
docker logs -f greenlight-v2-tmp &
|
|
LOGGING_PID=$!
|
|
|
|
while ! docker exec greenlight-v2-tmp nc -zw3 127.0.0.1 80
|
|
do
|
|
echo "Waiting for greenlight v2 to start up ..."
|
|
sleep 1
|
|
done
|
|
|
|
echo "greenlight is up! starting migrations"
|
|
|
|
docker exec -it greenlight-v2-tmp bundle exec rake migrations:roles && \
|
|
docker exec -it greenlight-v2-tmp bundle exec rake migrations:users && \
|
|
docker exec -it greenlight-v2-tmp bundle exec rake migrations:rooms && \
|
|
docker exec -it greenlight-v2-tmp bundle exec rake migrations:settings
|
|
|
|
kill $LOGGING_PID
|
|
docker kill greenlight-v2-tmp
|