#!/bin/bash

source /var/onap/functions

# compile_all_vfc_repos() - Function that compiles VF-C source repo.
function compile_all_vfc_repos {
    install_python_package tox

    tox_repos=("gvnfm/vnflcm/lcm" "gvnfm/vnfmgr/mgr" "gvnfm/vnfres/res" "nfvo/lcm" \
        "nfvo/driver/vnfm/gvnfm/gvnfmadapter" "nfvo/driver/vnfm/svnfm/zte/vmanager")
    for dirc in ${tox_repos[@]}; do
        pushd ${src_folders[vfc]}/$dirc
        tox -e py27
        popd
    done

    # TODO(sshank): Add compile for other vfc_repos. (Java based.)

    # Java based:
    # nfvo/catalog
    # nfvo/driver/ems/ems/sems/boco/ems-driver
    # nfvo/driver/sfc/zte/sfc-driver
    # nfvo/driver/vnfm/gvnfm/juju/juju-vnfmadapter
    # nfvo/driver/vnfm/svnfm/huawei/vnfmadapter
    # nfvo/resmanagement
    # nfvo/wfengine
}

# _build_vfc_image() - Build VFC  docker image
function _build_vfc_image {
    pushd ${src_folders[vfc]}/$1/docker
    sed -i "s/^push_image/#push_image/g" build_image.sh
    sed -i 's|IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}"|IMAGE_NAME=${ORG}/${IMAGE}|g' build_image.sh
    ./build_image.sh
    popd
}

# get_vfc_images() - Build VFC docker images
function get_vfc_images {
    if [[ "$build_image" == "True" ]]; then
        install_docker
        # Separate methods are required since the image build process will change.
        _build_vfc_image gvnfm/vnflcm/lcm onap/nslcm
        _build_vfc_image gvnfm/vnfmgr/mgr onap/gvnfmdriver
        _build_vfc_image gvnfm/vnfres/res onap/vnfres
        _build_vfc_image nfvo/lcm onap/vnflcm
        _build_vfc_image nfvo/driver/vnfm/gvnfm/gvnfmadapter

        build_gvnfm_lcm_image
        build_gvnfm_vnfmgr_image
        build_gvnfm_vnfres_image
        build_nfvo_lcm_image
        build_nfvo_vnfm_gvnfmadapter_image
        # TODO(sshank): Add other VFC component docker image builds.
    else
        for image in gvnfm/vnflcm/lcm gvnfm/vnfmgr/mgr gvnfm/vnfres/res nfvo/lcm nfvo/driver/vnfm/gvnfm/gvnfmadapter; do
            pull_onap_image vfc/$image
        done
    fi
}

# install_vfc() - Download and install vfc service from source code
function install_vfc {
    nslcm_image=`docker images | grep nslcm | grep latest| awk '{print $1 ":" $2}'`
    vnflcm_image=`docker images | grep vnflcm | grep latest| awk '{print $1 ":" $2}'`
    vnfmgr_image=`docker images | grep vnfmgr | grep latest| awk '{print $1 ":" $2}'`
    vnfres_image=`docker images | grep vnfres | grep latest| awk '{print $1 ":" $2}'`
    gvnfmdriver_image=`docker images | grep gvnfmdriver | grep latest| awk '{print $1 ":" $2}'`

    run_docker_image -d --name vfc-nslcm -p 8403:8403 -e MSB_ADDR=127.0.0.1 $nslcm_image
    run_docker_image -d --name vfc-vnflcm -p 8801:8801 -e MSB_ADDR=127.0.0.1 $vnflcm_image
    run_docker_image -d --name vfc-vnfmgr -p 8803:8803 -e MSB_ADDR=127.0.0.1 $vnfmgr_image
    run_docker_image -d --name vfc-vnfres -p 8802:8802 -e MSB_ADDR=127.0.0.1 $vnfres_image
    run_docker_image -d --name vfc-gvnfmdriver -p 8484:8484 -e MSB_ADDR=127.0.0.1 $gvnfmdriver_image

    # TODO(sshank): Run other VFC component docker images.
}

# init_vfc() - Function that initialize VF-C services
function init_vfc {
    install_package libmysqlclient-dev

    if [[ "$clone_repo" == "True" ]]; then
        clone_repos "vfc"
        if [[ "$compile_repo" == "True" ]]; then
            compile_all_vfc_repos
        fi
    fi

    if [[ "$skip_get_images" == "False" ]]; then
        get_vfc_images
        if [[ "$skip_install" == "False" ]]; then
            install_vfc
        fi
    fi
}
