Merge pull request #12 from gustavotrott/run-custom-script-on-create
Add param --custom-script to create_bbb.sh
This commit is contained in:
commit
612512fa04
@ -47,11 +47,12 @@ Docker **bbb 2.4**
|
|||||||
|
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
`./create_bbb.sh [--update] [--fork=github_user] [--domain=domain_name] [--ip=ip_address] [--image=docker_image] [--cert=certificate_dir] {name}`
|
`./create_bbb.sh [--update] [--fork=github_user] [--domain=domain_name] [--ip=ip_address] [--image=docker_image] [--cert=certificate_dir] [--custom-script=path/script.sh] {name}`
|
||||||
- {name}: Name of the container (e.g `bbb26`) **(REQUIRED)**
|
- {name}: Name of the container (e.g `bbb26`) **(REQUIRED)**
|
||||||
- --update: check for new image version `--update`
|
- --update: check for new image version `--update`
|
||||||
- --domain: set the host domain (e.g `--domain=test`), default: `test`. BBB URL will be `https://{NAME} + {DOMAIN}`
|
- --domain: set the host domain (e.g `--domain=test`), default: `test`. BBB URL will be `https://{NAME} + {DOMAIN}`
|
||||||
- --cert: specify the directory which contains a certificate (`fullchain.pem` and `privkey.pem`) (e.g `--cert=/tmp`) *(if absent a new certificate will be created)*
|
- --cert: specify the directory which contains a certificate (`fullchain.pem` and `privkey.pem`) (e.g `--cert=/tmp`) *(if absent a new certificate will be created)*
|
||||||
|
- --custom-script: path of a shell script file to be executed immediately when the container is created (useful for setting some personal preferences for configs)
|
||||||
- --ip: force container IP (e.g `--ip=172.17.0.2`)
|
- --ip: force container IP (e.g `--ip=172.17.0.2`)
|
||||||
- --fork: Username in Github with bbb Fork `--fork=bigbluebutton`
|
- --fork: Username in Github with bbb Fork `--fork=bigbluebutton`
|
||||||
- --image: Force an image different than default `--image=imdt/bigbluebutton:2.6.x-develop`
|
- --image: Force an image different than default `--image=imdt/bigbluebutton:2.6.x-develop`
|
||||||
|
@ -20,6 +20,7 @@ IP=172.17.0.2
|
|||||||
IMAGE=imdt/bigbluebutton:2.6.x-develop
|
IMAGE=imdt/bigbluebutton:2.6.x-develop
|
||||||
GITHUB_USER=
|
GITHUB_USER=
|
||||||
CERT_DIR=
|
CERT_DIR=
|
||||||
|
CUSTOM_SCRIPT=
|
||||||
REMOVE_CONTAINER=0
|
REMOVE_CONTAINER=0
|
||||||
CONTAINER_IMAGE=
|
CONTAINER_IMAGE=
|
||||||
|
|
||||||
@ -110,6 +111,8 @@ do
|
|||||||
GITHUB_USER=${var#*=}
|
GITHUB_USER=${var#*=}
|
||||||
elif [[ $var == --cert* ]] ; then
|
elif [[ $var == --cert* ]] ; then
|
||||||
CERT_DIR=${var#*=}
|
CERT_DIR=${var#*=}
|
||||||
|
elif [[ $var == --custom-script* ]] ; then
|
||||||
|
CUSTOM_SCRIPT=${var#*=}
|
||||||
elif [[ $var == --domain* ]] ; then
|
elif [[ $var == --domain* ]] ; then
|
||||||
DOMAIN=${var#*=}
|
DOMAIN=${var#*=}
|
||||||
fi
|
fi
|
||||||
@ -229,6 +232,11 @@ mkdir -p $HOME/.ivy2/local/org.bigbluebutton
|
|||||||
|
|
||||||
docker run -d --name=$NAME --hostname=$HOSTNAME $NETWORKPARAMS -env="container=docker" --env="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" --env="DEBIAN_FRONTEND=noninteractive" -v "/var/run/docker.sock:/docker.sock:rw" --cap-add="NET_ADMIN" --privileged -v "$HOME/$NAME/certs/:/local/certs:rw" --cgroupns=host -v "$BBB_SRC_FOLDER:/home/bigbluebutton/src:rw" -v "/tmp:/tmp:rw" -v "$HOME/.m2/repository/org/bigbluebutton:/home/bigbluebutton/.m2/repository/org/bigbluebutton:rw" -v "$HOME/.ivy2/local/org.bigbluebutton:/home/bigbluebutton/.ivy2/local/org.bigbluebutton:rw" -t $IMAGE
|
docker run -d --name=$NAME --hostname=$HOSTNAME $NETWORKPARAMS -env="container=docker" --env="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" --env="DEBIAN_FRONTEND=noninteractive" -v "/var/run/docker.sock:/docker.sock:rw" --cap-add="NET_ADMIN" --privileged -v "$HOME/$NAME/certs/:/local/certs:rw" --cgroupns=host -v "$BBB_SRC_FOLDER:/home/bigbluebutton/src:rw" -v "/tmp:/tmp:rw" -v "$HOME/.m2/repository/org/bigbluebutton:/home/bigbluebutton/.m2/repository/org/bigbluebutton:rw" -v "$HOME/.ivy2/local/org.bigbluebutton:/home/bigbluebutton/.ivy2/local/org.bigbluebutton:rw" -t $IMAGE
|
||||||
|
|
||||||
|
if [ $CUSTOM_SCRIPT ] && [ -f $CUSTOM_SCRIPT ] ; then
|
||||||
|
echo "Executing $CUSTOM_SCRIPT on container $NAME"
|
||||||
|
cat $CUSTOM_SCRIPT | docker exec -i $NAME bash
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir $HOME/.bbb/ &> /dev/null
|
mkdir $HOME/.bbb/ &> /dev/null
|
||||||
echo "docker exec -u bigbluebutton -w /home/bigbluebutton/ -it $NAME /bin/bash -l" > $HOME/.bbb/$NAME.sh
|
echo "docker exec -u bigbluebutton -w /home/bigbluebutton/ -it $NAME /bin/bash -l" > $HOME/.bbb/$NAME.sh
|
||||||
chmod 755 $HOME/.bbb/$NAME.sh
|
chmod 755 $HOME/.bbb/$NAME.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user