diff options
author | su622b <sunil.unnava@att.com> | 2018-04-23 12:02:24 -0400 |
---|---|---|
committer | su622b <sunil.unnava@att.com> | 2018-04-23 12:02:53 -0400 |
commit | f5b6899dafee9f9473ee1d7405ede512ce1dc577 (patch) | |
tree | 93bf0506727554c9bd0b717c4cd2f5e67dbbc1cc /demo/deploy.sh | |
parent | 0643517a9fd0d4d23ebef740e2b3cc18f41c9318 (diff) |
Move HEAT files to MR project
Issue-ID: DMAAP-433
Change-Id: Ib7ac91d0fb3e99f345ba640ed4647b09d62ed5ff
Signed-off-by: su622b <sunil.unnava@att.com>
Diffstat (limited to 'demo/deploy.sh')
-rw-r--r-- | demo/deploy.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/demo/deploy.sh b/demo/deploy.sh new file mode 100644 index 0000000..b11a1e0 --- /dev/null +++ b/demo/deploy.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +set -e + +# do not change this, it is already matched with the git repo file structure +DOCKER_FILE_DIR='./docker_files' + +KAFKA_VERSION='0.8.1.1' +SCALA_VERSION='2.9.2' +wget -q "http://www.namesdir.com/mirrors/apache/kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" \ + -O "./docker_files/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" + +# commands to run docker and docker-compose +DOCKER_COMPOSE_EXE='/opt/docker/docker-compose' + +cd "${DOCKER_FILE_DIR}" + +while ! ifconfig |grep "docker0" > /dev/null; + do sleep 1 + echo 'waiting for docker operational' +done + +echo "prep any files with local configurations" +if ls __* 1> /dev/null 2>&1; then + IP_DOCKER0=$(ifconfig docker0 |grep "inet addr" | cut -d: -f2 |cut -d" " -f1) + TEMPLATES=$(ls -1 __*) + for TEMPLATE in $TEMPLATES + do + FILENAME=${TEMPLATE//_} + if [ ! -z "${IP_DOCKER0}" ]; then + sed -e "s/{{ ip.docker0 }}/${IP_DOCKER0}/" "$TEMPLATE" > "$FILENAME" + fi + done +fi + +if [ -z "$MTU" ]; then + export MTU=$(ifconfig docker0 |grep MTU |sed -e 's/.*MTU://' -e 's/\s.*$//') +fi + +echo "starting docker operations" +${DOCKER_COMPOSE_EXE} up -d --build |