3 if [ -f "/opt/docker/docker-compose" ];
5 DOCKER_COMPOSE_CMD="/opt/docker/docker-compose -f docker-compose-db.yml"
7 DOCKER_COMPOSE_CMD="docker-compose -f docker-compose-db.yml"
10 export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1);
11 export HBASE_IMAGE="${HBASE_IMAGE:-aaionap/hbase}";
12 export HBASE_VERSION="${HBASE_VERSION:-1.2.0}";
14 function wait_for_container() {
21 # wait for the real startup
22 AMOUNT_STARTUP=$(docker logs ${CONTAINER_NAME} 2>&1 | grep "$START_TEXT" | wc -l)
23 while [[ ${AMOUNT_STARTUP} -ne 1 ]];
25 echo "Waiting for '$CONTAINER_NAME' deployment to finish ..."
26 AMOUNT_STARTUP=$(docker logs ${CONTAINER_NAME} 2>&1 | grep "$START_TEXT" | wc -l)
27 if [ "$TIMEOUT" = "0" ];
29 echo "ERROR: $CONTAINER_NAME deployment failed."
37 docker pull cassandra:2.1;
40 $DOCKER_COMPOSE_CMD stop
41 $DOCKER_COMPOSE_CMD rm -f -v
43 CASSANDRA_CONTAINER_NAME=$($DOCKER_COMPOSE_CMD up -d aai.hbase.simpledemo.onap.org 2>&1 | grep 'Creating' | grep -v 'volume' | grep -v 'network' | awk '{ print $2; }' | head -1);
44 wait_for_container $CASSANDRA_CONTAINER_NAME 'Listening for thrift clients';
46 $DOCKER_COMPOSE_CMD up -d aai.elasticsearch.simpledemo.openecomp.org