#!/bin/bash

set -o xtrace

source /var/onap/functions

portal_src_folder=$git_src_folder/portal
portal_repos=("sdk")

# clone_all_portal_repos() - Function that clones Portal source repo.
function clone_all_portal_repos {
    clone_repo portal $portal_src_folder
    clone_repo ecompsdkos $portal_src_folder/ecompsdkos
    clone_repo "ui/dmaapbc" $portal_src_folder/dmaapbc

    for dirc in ${portal_repos[@]}; do
        clone_repo portal/$dirc $portal_src_folder/$dirc
    done
}

# compile_all_portal_repos() - Function that compiles Portal source repo.
function compile_all_portal_repos {
    compile_src $portal_src_folder

    for dirc in ${portal_repos[@]}; do
        compile_src $portal_src_folder/$dirc
    done
}

# _build_portal_images() - Function that builds Portal Docker images from source code
function _build_portal_images {
    install_maven

    pushd $portal_src_folder/deliveries
    chmod +x *.sh
    export MVN=$(which mvn)
    export GLOBAL_SETTINGS_FILE=/usr/share/maven3/conf/settings.xml
    export SETTINGS_FILE=$HOME/.m2/settings.xml
    bash build_portalapps_dockers.sh
    popd
}

# get_portal_images() - Function to get Portal images.
function get_portal_images {
    if [[ "$build_image" == "True" ]]; then
        _build_portal_images
    else
        pull_openecomp_image portaldb ecompdb:portal
        pull_openecomp_image portalapps ep:1610-1
    fi
    pull_docker_image mariadb
}

# _install_mariadb() - Pull and create a MariaDB container
function _install_mariadb {
    docker create --name data_vol_portal -v /var/lib/mysql mariadb
}

# install_portal() - Function that installs the source code of Portal
function install_portal {
    install_docker
    docker rm -f ecompdb_portal
    docker rm -f 1610-1

    pushd $portal_src_folder/deliveries
    mkdir -p /PROJECT/OpenSource/UbuntuEP/logs
    install_package unzip
    unzip -o etc.zip -d /PROJECT/OpenSource/UbuntuEP/

    _install_mariadb
    install_docker_compose
    bash portal_vm_init.sh

    sleep 180

    if [ ! -e /opt/config/boot.txt ]; then
        install_package mysql-client
        mysql -u root -p'Aa123456' -h $IP_ADDRESS < Apps_Users_OnBoarding_Script.sql
        echo "yes" > /opt/config/boot.txt
    fi
    popd
}

# init_portal() - Function that initialize Portal services
function init_portal {
    if [[ "$clone_repo" == "True" ]]; then
        clone_all_portal_repos
        if [[ "$compile_repo" == "True" ]]; then
            compile_all_portal_repos
        fi
    fi

    if [[ "$skip_get_images" == "False" ]]; then
        get_portal_images
        if [[ "$skip_install" == "False" ]]; then
            install_portal
        fi
    fi
}
