Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions after-start.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/sh -e
NETWORK=${NETWORK:-"kazoo"}

NETWORK=${NETWORK:-'kazoo'}
echo wait for kazoo.$NETWORK to start '(you may check docker logs if impatient)'
watch -g "docker logs kazoo.$NETWORK | grep 'auto-started kapps'" > /dev/null

cd kazoo
echo -n "create master account: "
echo -n 'create master account: '
./sup crossbar_maintenance create_account admin kamailio.$NETWORK admin admin
echo -n "add freeswitch to kazoo: "
echo -n 'add freeswitch to kazoo: '
./sup ecallmgr_maintenance add_fs_node freeswitch@freeswitch.$NETWORK

echo -n "enable console debug: "
echo -n 'enable console debug: '
./sup kazoo_maintenance console_level debug

echo wait fot freeswitch to complete connect
Expand All @@ -33,8 +34,8 @@ rm -rf apps
docker exec -i --user root kazoo.$NETWORK rm -rf apps

echo refresh kamailio dispatcher
docker exec -i kamailio.$NETWORK kamcmd dispatcher.reload
docker exec -i kamailio.$NETWORK kamcmd dispatcher.reload

echo commit couchdb to couchdb-init
docker commit couchdb.$NETWORK $NETWORK/couchdb-init
cd ../
cd ..
2 changes: 2 additions & 0 deletions base-os/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM debian:jessie
MAINTAINER Roman Galeev <jamhed@2600hz.com>

ARG NETWORK

ENV DEBIAN_FRONTEND noninteractive
ENV APT_LISTCHANGES_FRONTEND=none

Expand Down
8 changes: 6 additions & 2 deletions base-os/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh -e
NETWORK=${NETWORK:-"kazoo"}
docker build $BUILD_FLAGS -t $NETWORK/base-os .

NETWORK=${NETWORK:-'kazoo'}

docker build $BUILD_FLAGS \
--build-arg NETWORK=$NETWORK \
-t $NETWORK/base-os .
1 change: 1 addition & 0 deletions bin/docker-cleanup
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -e

docker rm $(docker ps -a --filter status=dead -q)
docker rm $(docker ps -a --filter status=exited -q)
docker rmi $(docker images -a --filter=dangling=true -q)
5 changes: 3 additions & 2 deletions bin/find-debian-deps.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
DIR=${1:-"./"}

DIR=${1:-'./'}
find $DIR | while read file
do
objdump -p $file 2>/dev/null | grep NEEDED
objdump -p $file 2>/dev/null | grep NEEDED
done | while read a b; do echo $b; done | sort | uniq | while read file; do dpkg -S $file 2>/dev/null; done | cut -d: -f 1 | sort | uniq
9 changes: 5 additions & 4 deletions bin/get-commit
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/sh -e
if [ "$1" = "" ]

if [ "$1" = '' ]
then
echo Usage: $0 remote-git-uri
exit
echo Usage: $0 remote-git-uri
exit
fi

git ls-remote $1 | head -1 | sed "s/HEAD//"
git ls-remote $1 | head -1 | sed 's/HEAD//'
11 changes: 6 additions & 5 deletions bin/get-ip
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/sh -e
NETWORK=${NETWORK:-"kazoo"}
if [ "$1" = "" ]

NETWORK=${NETWORK:-'kazoo'}
if [ "$1" = '' ]
then
echo Usage: $0 container
exit
echo Usage: $0 container
exit
fi

docker inspect --format "{{ (index .NetworkSettings.Networks \"$NETWORK\").IPAddress }}" $1
docker inspect --format '{{ (index .NetworkSettings.Networks "'$NETWORK'").IPAddress }}' $1
3 changes: 2 additions & 1 deletion bin/uncolor
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/sh -e
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"

sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g'
42 changes: 30 additions & 12 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
#!/bin/bash
#!/bin/bash -e

INSTALLED=`docker version --format '{{.Server.Version}}'`
REQUIRED="1.9.0"
if [ "$(printf "$REQUIRED\n$INSTALLED" | sort -V | head -n1)" == "$INSTALLED" ] && [ "$INSTALLED" != "$REQUIRED" ]
if [ "$INSTALLED" != "$REQUIRED" ] && [ "$(printf "$REQUIRED\n$INSTALLED" | sort -V | head -n1)" == "$INSTALLED" ]
then
echo Docker version $INSTALLED is probably too old, required version is $REQUIRED
exit
echo Docker version $INSTALLED is probably too old, required version is $REQUIRED
exit
fi
cd base-os && ./build.sh
cd ../kazoo-erlang && ./build.sh
cd ../rabbitmq && ./build.sh
cd ../couchdb &&./build.sh
cd ../kamailio && ./build.sh d62fd3e4976633aa6b827d527f4e15de0b08068b

pushd base-os
./build.sh
popd
pushd kazoo-erlang
./build.sh
popd
pushd rabbitmq
./build.sh
popd
pushd couchdb
./build.sh
popd
pushd kamailio
./build.sh 4.4.5
popd
pushd freeswitch
# 1.6.13
cd ../freeswitch && ./build.sh e755b430da70bd63eebf1dfddacdce48ce863fce
cd ../kazoo && ./build.sh
cd ../monster-ui && ./build.sh
./build.sh e755b430da70bd63eebf1dfddacdce48ce863fce
popd
pushd kazoo
./build.sh
popd
pushd monster-ui
./build.sh
popd
3 changes: 2 additions & 1 deletion cluster/after-start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -e

echo Init the system

./sup crossbar_maintenance create_account admin kamailio.kazoo admin admin
Expand All @@ -12,4 +13,4 @@ rm -rf apps

./sup crossbar_maintenance init_apps /home/user/apps http://kazoo.kazoo:8000/v2

docker exec -ti kamailio.kazoo kamctl dispatcher reload
docker exec -ti kamailio.kazoo kamctl dispatcher reload
5 changes: 3 additions & 2 deletions cluster/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -e

docker network create kazoo
docker network create zone1
docker network create zone2
Expand All @@ -13,11 +14,11 @@ RABBITMQ_IP=$(bin/get-ip rabbitmq.kazoo)
COUCHDB_IP=$(bin/get-ip couchdb.kazoo)

export NETWORK=zone1
kazoo/run.sh "-td --add-host rabbitmq.kazoo:$RABBITMQ_IP --add-host couchdb.kazoo:$COUCHDB_IP"
kazoo/run.sh '-td --add-host rabbitmq.kazoo:'$RABBITMQ_IP' --add-host couchdb.kazoo:'$COUCHDB_IP
freeswitch/run.sh

export NETWORK=zone2
kazoo/run.sh "-td --add-host rabbitmq.kazoo:$RABBITMQ_IP --add-host couchdb.kazoo:$COUCHDB_IP"
kazoo/run.sh '-td --add-host rabbitmq.kazoo:'$RABBITMQ_IP' --add-host couchdb.kazoo:'$COUCHDB_IP
freeswitch/run.sh

# disable isolation
Expand Down
2 changes: 1 addition & 1 deletion cluster/stop.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -e

docker stop monster-ui.kazoo
docker stop kamailio.kazoo
docker stop couchdb.kazoo
Expand All @@ -13,4 +14,3 @@ docker stop kazoo.zone2
docker network rm kazoo
docker network rm zone1
docker network rm zone2

1 change: 1 addition & 0 deletions cluster/sup
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/sh -e

docker exec -ti kazoo.zone1 sup "$*"
7 changes: 5 additions & 2 deletions couchdb/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/sh -e
NETWORK=${NETWORK:-"kazoo"}
docker build $BUILD_FLAGS -t $NETWORK/couchdb2 .

NETWORK=${NETWORK:-'kazoo'}

docker build $BUILD_FLAGS \
-t $NETWORK/couchdb2 .
23 changes: 12 additions & 11 deletions couchdb/run.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
#!/bin/sh -e
FLAGS=${1:-"-td"}
IMAGE=${2:-"kazoo/couchdb2"}
NETWORK=${NETWORK:-"kazoo"}

FLAGS=${1:-'-td'}
IMAGE=${2:-'kazoo/couchdb2'}
NETWORK=${NETWORK:-'kazoo'}
NAME=couchdb.$NETWORK

if [ -n "$(docker ps -aq -f name=$NAME)" ]
then
echo -n "stopping: "
docker stop -t 1 $NAME
echo -n "removing: "
docker rm -f $NAME
echo -n 'stopping: '
docker stop -t 1 $NAME
echo -n 'removing: '
docker rm -f $NAME
fi
echo -n "starting: $NAME "

docker run $FLAGS \
--net $NETWORK \
-h $NAME \
--name $NAME \
$IMAGE
--net $NETWORK \
-h $NAME \
--name $NAME \
$IMAGE
7 changes: 5 additions & 2 deletions couchdb1.6/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/sh -e
NETWORK=${NETWORK:-"kazoo"}
docker build $BUILD_FLAGS -t $NETWORK/couchdb .

NETWORK=${NETWORK:-'kazoo'}

docker build $BUILD_FLAGS \
-t $NETWORK/couchdb .
23 changes: 12 additions & 11 deletions couchdb1.6/run.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
#!/bin/sh -e
FLAGS=${1:-"-td"}
IMAGE=${2:-"kazoo/couchdb"}
NETWORK=${NETWORK:-"kazoo"}

FLAGS=${1:-'-td'}
IMAGE=${2:-'kazoo/couchdb'}
NETWORK=${NETWORK:-'kazoo'}
NAME=couchdb.$NETWORK

if [ -n "$(docker ps -aq -f name=$NAME)" ]
then
echo -n "stopping: "
docker stop -t 1 $NAME
echo -n "removing: "
docker rm -f $NAME
echo -n 'stopping: '
docker stop -t 1 $NAME
echo -n 'removing: '
docker rm -f $NAME
fi
echo -n "starting: $NAME "

docker run $FLAGS \
--net $NETWORK \
-h $NAME \
--name $NAME \
$IMAGE
--net $NETWORK \
-h $NAME \
--name $NAME \
$IMAGE
5 changes: 3 additions & 2 deletions export/all.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
export NETWORK=${NETWORK:-"kazoo"}
docker rmi -f $(docker images | grep "2600hz/" | cut -d' ' -f 1)

export NETWORK=${NETWORK:-'kazoo'}
docker rmi -f $(docker images | grep '2600hz/' | cut -d' ' -f 1)
cd ~/kazoo-docker/export/couchdb && ./build.sh
cd ../rabbitmq && ./build.sh
cd ../kazoo && ./extract.sh kazoo.$NETWORK && ./build.sh
Expand Down
22 changes: 12 additions & 10 deletions export/rabbitmq/run.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/bin/sh -e
FLAGS=${1:-"-td"}
NETWORK=${NETWORK:-"kazoo"}

FLAGS=${1:-'-td'}
NETWORK=${NETWORK:-'kazoo'}
NAME=rabbitmq.$NETWORK
if [ -n "$(docker ps -aq -f name=$NAME)" ]
then
echo -n "stopping: "
docker stop -t 1 $NAME
echo -n "removing: "
docker rm -f $NAME
echo -n 'stopping: '
docker stop -t 1 $NAME
echo -n 'removing: '
docker rm -f $NAME
fi

echo -n "starting: $NAME "
docker run $FLAGS \
--net $NETWORK \
-h $NAME \
--name $NAME \
2600hz/rabbitmq
--net $NETWORK \
-h $NAME \
--name $NAME \
2600hz/rabbitmq
8 changes: 3 additions & 5 deletions freeswitch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ MAINTAINER Roman Galeev <jamhed@2600hz.com>

USER root

ARG REPO=https://freeswitch.org/stash/scm/fs/freeswitch.git
ARG NETWORK
ARG REPO
ARG FREESWITCH_COMMIT
ARG CONFIG=master

COPY build/setup-os.sh build/setup-os.sh
Expand All @@ -12,10 +14,6 @@ RUN build/setup-os.sh
COPY build/setup.sh build/setup.sh
RUN build/setup.sh

COPY etc/commit commit
COPY build/setup-commit.sh build/setup-commit.sh
RUN build/setup-commit.sh

COPY etc/modules.conf freeswitch/modules.conf
COPY build/configure.sh build/configure.sh
RUN build/configure.sh
Expand Down
13 changes: 8 additions & 5 deletions freeswitch/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/sh -e
NETWORK=${NETWORK:-"kazoo"}
REPO=${2:-"https://freeswitch.org/stash/scm/fs/freeswitch.git"}
COMMIT=${1:-"$(../bin/get-commit $REPO)"}

echo $COMMIT > etc/commit
NETWORK=${NETWORK:-'kazoo'}
REPO=${2:-'https://freeswitch.org/stash/scm/fs/freeswitch.git'}
COMMIT=${1:-"$(../bin/get-commit $REPO)"}

docker build $BUILD_FLAGS --build-arg REPO=$REPO -t $NETWORK/freeswitch .
docker build $BUILD_FLAGS \
--build-arg NETWORK=$NETWORK \
--build-arg REPO=$REPO \
--build-arg FREESWITCH_COMMIT=$COMMIT \
-t $NETWORK/freeswitch .
4 changes: 2 additions & 2 deletions freeswitch/build/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh -e
cd freeswitch
make

cd freeswitch && make
3 changes: 0 additions & 3 deletions freeswitch/build/setup-commit.sh

This file was deleted.

7 changes: 2 additions & 5 deletions freeswitch/build/setup-config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/bin/sh -e
CONFIG=${CONFIG:-"master"}
git clone https://github.com/2600hz/kazoo-configs.git kazoo-configs
cd kazoo-configs
git reset --hard $CONFIG
cd ../

git clone --depth 1 --branch="$CONFIG" https://github.com/2600hz/kazoo-configs.git kazoo-configs
1 change: 1 addition & 0 deletions freeswitch/build/setup-os.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -e

apt-get install -y --force-yes freeswitch-video-deps-most \
ladspa-sdk tap-plugins swh-plugins libgsm1 libfftw3-3 autotalent \
librabbitmq-dev
Expand Down
3 changes: 2 additions & 1 deletion freeswitch/build/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/sh -e
git clone $REPO freeswitch

git clone --depth 1 $REPO --branch=$FREESWITCH_COMMIT freeswitch
Loading