#!/bin/bash

set -o xtrace

source /var/onap/functions

portal_src_folder=$git_src_folder/portal
portal_repos=("portal" "portal/sdk" "ecompsdkos" "ui/dmaapbc")

# clone_all_portal_repos() - Function that clones Portal source repo.
function clone_all_portal_repos {
    for repo in ${portal_repos[@]}; do
        if [[ "$repo" == "ui/dmaapbc" ]];then
            prefix="ui"
        else
            prefix="portal"
        fi
        clone_repo $repo $portal_src_folder/${repo#*$prefix}
    done
}

# compile_all_portal_repos() - Function that compiles Portal source repo.
function compile_all_portal_repos {
    for repo in ${portal_repos[@]}; do
        if [[ "$repo" == "ui/dmaapbc" ]];then
            prefix="ui"
        else
            prefix="portal"
        fi
        compile_src $portal_src_folder/${repo#*$prefix}
    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
}
