Skip to content

Commit

Permalink
openvidu-test-e2e: improved "docker inspect" command to get docker ga…
Browse files Browse the repository at this point in the history
…teway IP
  • Loading branch information
pabloFuente committed Oct 5, 2023
1 parent 4384a74 commit beecb10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ci-scripts/openvidu-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function environmentLaunch {

# Kurento and mediasoup needs to run as network host, so we need Docker host IP.
local DOCKER_HOST_IP
DOCKER_HOST_IP="$(docker network inspect bridge | grep Subnet | cut -d'"' -f4 | cut -d'/' -f1 | sed 's/.$/1/' | grep 172)"
DOCKER_HOST_IP="$(docker inspect bridge --format '{{with index .IPAM.Config 0}}{{or .Gateway .Subnet}}{{end}}' | sed -r 's|\.0/[[:digit:]]+$|.1|')"

if [[ "${MEDIA_SERVER}" == "kurento" ]]; then
docker run -e KMS_UID=$(id -u) --network=host --detach=true --volume=/opt/openvidu/recordings:/opt/openvidu/recordings "${KURENTO_MEDIA_SERVER_IMAGE}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ protected void startMediaServer(boolean waitUntilKurentoClientReconnection) {
+ " --volume=/opt/openvidu/recordings:/opt/openvidu/recordings " + MEDIA_SERVER_IMAGE;
} else if (MEDIA_SERVER_IMAGE.startsWith(MEDIASOUP_IMAGE)) {
log.info("Starting mediaSoup");
command = "docker network inspect bridge | grep Subnet | cut -d'\"' -f4 | cut -d'/' -f1 | sed 's/.$/1/' | grep 172";
command = "docker inspect bridge --format '{{with index .IPAM.Config 0}}{{or .Gateway .Subnet}}{{end}}' | sed -r 's|\\.0/[[:digit:]]+$|.1|'";
String dockerGatewayIp = commandLine.executeCommand(command, false, 5);
log.info("Discovered docker gateway IP is {}", dockerGatewayIp);
command = "LOG_DATE=$(printf '%(%Y-%m-%d-%H-%M-%S)T'); docker run --network=host --restart=always --env=KMS_MIN_PORT=40000 --env=KMS_MAX_PORT=65535"
Expand Down

0 comments on commit beecb10

Please sign in to comment.