#!/bin/bash
# Deployment script for MSO lab
# ===================================================
# Available parameters :
#
# env DOCKER_HOST (optional)
#     | sets the docker host to be used if not local unix socket
#
# env MSO_CONFIG_UPDATES (optional)
#     | json structure that matches volumes/mso/chef-config/mso-docker.json
#     | elements whose value needs to be updated before the deployment
#     | phase.
#
# env MSO_DOCKER_IMAGE_VERSION
#     | json structure that matches volumes/mso/chef-config/mso-docker.json
#     | elements whose value needs to be updated before the deployment
#     | phase.
################################### Functions definition ################################

NEXUS=1
if [ "$#" = 0 ]; then
    echo "Deploying with local images, not pulling them from Nexus."
    NEXUS=0
fi

if [ "$#" -ne 6 ] && [ $NEXUS -eq 1 ]; then
        echo "Usage: deploy.sh <NEXUS_HOST_MSO:NEXUS_PORT_MSO> <NEXUS_LOGIN_MSO> <NEXUS_PASSWORD_MSO> <NEXUS_HOST_MARIADB:NEXUS_PORT_MARIADB> <NEXUS_LOGIN_MARIADB> <NEXUS_PASSWORD_MARIADB>
              - env DOCKER_HOST (optional) 
                 sets the docker host to be used if not local unix socket 
     
              - env MSO_DOCKER_IMAGE_VERSION (required)
                 sets the mso docker image version
     
              - env MSO_CONFIG_UPDATES (optional) 
                json structure that matches volumes/mso/chef-config/mso-docker.json 
                elements whose value needs to be updated before the deployment 
                phase."
        
        exit 1
fi

if [ -z "$MSO_DOCKER_IMAGE_VERSION" ] && [ $NEXUS -eq 1 ]; then
        echo "Env variable MSO_DOCKER_IMAGE_VERSION must be SET to a version before running this script" 
        exit 1
fi

NEXUS_DOCKER_REPO_MSO=$1
NEXUS_USERNAME_MSO=$2
NEXUS_PASSWD_MSO=$3
NEXUS_DOCKER_REPO_MARIADB=$4
NEXUS_USERNAME_MARIADB=$5
NEXUS_PASSWD_MARIADB=$6



function init_docker_command() {
    if [ -z ${DOCKER_HOST+x} ];
    then
        DOCKER_CMD="docker"
        LBL_DOCKER_HOST="local docker using unix socket"
    else
        DOCKER_CMD="docker -H ${DOCKER_HOST}"
        LBL_DOCKER_HOST="(remote) docker using ${DOCKER_HOST}"  
    fi

    if [ -f "/opt/docker/docker-compose" ];
    then
        DOCKER_COMPOSE_CMD="/opt/docker/docker-compose"
    else
        DOCKER_COMPOSE_CMD="docker-compose"
    fi

    echo "docker command: ${LBL_DOCKER_HOST}"
}

function container_name() {
    SERVICE=$1
    BASE=$(echo $(basename `pwd`) | sed "s/[^a-z0-9]//i" | tr [:upper:] [:lower:])
    echo ${BASE}_${SERVICE}_1
}

function update_json_config() {
    if [ -n "$MSO_CONFIG_UPDATES" ];
    then   
        chmod u+x $SCRIPT_DIR/json_updater.py
        echo $MSO_CONFIG_UPDATES | $SCRIPT_DIR/json_updater.py $SCRIPT_DIR/volumes/mso/chef-config/mso-docker.json
        echo "MSO docker JSON updated"
    fi
    
}

function pull_docker_images() {
    echo "Using Nexus for MSO: $NEXUS_DOCKER_REPO_MSO (user "$NEXUS_USERNAME_MSO")"
    # login to nexus
    $DOCKER_CMD login -u $NEXUS_USERNAME_MSO -p $NEXUS_PASSWD_MSO $NEXUS_DOCKER_REPO_MSO
    $DOCKER_CMD login -u $NEXUS_USERNAME_MARIADB -p $NEXUS_PASSWD_MARIADB $NEXUS_DOCKER_REPO_MARIADB
    
    # get images
    $DOCKER_CMD pull $NEXUS_DOCKER_REPO_MSO/openecomp/mso:$MSO_DOCKER_IMAGE_VERSION
    $DOCKER_CMD tag $NEXUS_DOCKER_REPO_MSO/openecomp/mso:$MSO_DOCKER_IMAGE_VERSION openecomp/mso:latest
    $DOCKER_CMD rmi $NEXUS_DOCKER_REPO_MSO/openecomp/mso:$MSO_DOCKER_IMAGE_VERSION
    
    echo "Using Nexus for MARIADB: $NEXUS_DOCKER_REPO_MARIADB (user "$NEXUS_USERNAME_MARIADB")"
    $DOCKER_CMD pull $NEXUS_DOCKER_REPO_MARIADB/mariadb:10.1.11
    $DOCKER_CMD tag  $NEXUS_DOCKER_REPO_MARIADB/mariadb:10.1.11  mariadb:10.1.11
    $DOCKER_CMD rmi $NEXUS_DOCKER_REPO_MARIADB/mariadb:10.1.11

}

function wait_for_mariadb() {
    CONTAINER_NAME=$1
   
    TIMEOUT=600
    
    # wait for the real startup
    AMOUNT_STARTUP=$($DOCKER_CMD logs ${CONTAINER_NAME} 2>&1 | grep 'mysqld: ready for connections.' | wc -l)
    while [[ ${AMOUNT_STARTUP} -lt 1 ]];
    do
    echo "Waiting for '$CONTAINER_NAME' deployment to finish ..."
    AMOUNT_STARTUP=$($DOCKER_CMD logs ${CONTAINER_NAME} 2>&1 | grep 'mysqld: ready for connections.' | wc -l)
    if [ "$TIMEOUT" = "0" ];
    then
        echo "ERROR: Mariadb deployment failed."
        exit 1
    fi
    let TIMEOUT-=5
    sleep 5
    done
}

################################### Script entry - Starting CODE ################################
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

init_docker_command
update_json_config
if [ $NEXUS -eq 1 ]; then
    pull_docker_images
fi

# don't remove the containers,no cleanup
#$DOCKER_COMPOSE_CMD stop 
#$DOCKER_COMPOSE_CMD rm -f -v

# deploy
#Running docker-compose up -d starts the containers in the background and leaves them running.
#If there are existing containers for a service, and the service’s configuration or image was changed after the container’s creation, docker-compose up picks up the changes by stopping and recreating the containers (preserving mounted volumes). To prevent Compose from picking up changes, use the --no-recreate flag.
#If you want to force Compose to stop and recreate all containers, use the --force-recreate flag.
$DOCKER_COMPOSE_CMD up -d --no-recreate mariadb 
CONTAINER_NAME=$(container_name mariadb)
wait_for_mariadb $CONTAINER_NAME
$DOCKER_COMPOSE_CMD up -d mso 
