#!/bin/bash

set -o xtrace

source /var/onap/functions

vid_src_folder=$git_src_folder/vid
vid_repos=("vid" "vid/asdcclient")

# clone_all_vid_repos() - Function that clones VID source code.
function clone_all_vid_repos {
    for repo in ${vid_repos[@]}; do
        clone_repo $repo $vid_src_folder${repo#*vid}
    done
}

# compile_all_vid_repos() - Function that compiles VID source repo.
function compile_all_vid_repos {
    for repo in ${vid_repos[@]}; do
        compile_src $vid_src_folder${repo#*vid}
    done
}

# _build_vid_images() - Function that builds VID docker images
function _build_vid_images {
    if [[ "$compile_repo" != "True" ]]; then
        compile_src $vid_src_folder
    fi
    build_docker_image $vid_src_folder/deliveries
}

# get_vid_images() - Function that retrieves VID docker images
function get_vid_images {
    if [[ "$build_image" == "True" ]]; then
        _build_vid_images
    else
        pull_openecomp_image vid
    fi
    pull_docker_image mariadb:10
}

# install_vid() - Download and configure Vid source code
function install_vid {
    vid_image=`docker images | grep vid | grep latest| awk '{print $1 ":" $2}'`

    docker rm -f vid-mariadb
    docker rm -f vid-server

    docker run --name vid-mariadb -e MYSQL_DATABASE=vid_openecomp -e MYSQL_USER=vidadmin -e MYSQL_PASSWORD=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U -e MYSQL_ROOT_PASSWORD=LF+tp_1WqgSY -v /opt/vid/lf_config/vid-my.cnf:/etc/mysql/my.cnf -v /opt/vid/lf_config/vid-pre-init.sql:/docker-entrypoint-initdb.d/vid-pre-init.sql -v /var/lib/mysql -d mariadb:10
    docker run -e VID_MYSQL_DBNAME=vid_openecomp -e VID_MYSQL_PASS=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U --name vid-server -p 8080:8080 --link vid-mariadb:vid-mariadb-docker-instance -d $vid_image
}

# init_vid() - Function that initialize Vid services
function init_vid {
    if [[ "$clone_repo" == "True" ]]; then
        clone_all_vid_repos
        if [[ "$compile_repo" == "True" ]]; then
            compile_all_vid_repos
        fi
    fi

    if [[ "$skip_get_images" == "False" ]]; then
        get_vid_images
        if [[ "$skip_install" == "False" ]]; then
            install_vid
        fi
    fi
}
