#!/bin/bash

source /var/onap/functions

# _init_data_folders() - Function that initialize the data folders
function _init_data_folders {
    mkdir -p /data/environments
    mkdir -p /data/scripts
    mkdir -p /data/logs/BE
    mkdir -p /data/logs/FE
    chmod 777 /data
    chmod 777 /data/logs
}

# _setup_docker_aliases() - Function that setups the aliases required by sdc scripts
function _setup_docker_aliases {
    cat <<EOL > /root/.bash_aliases
alias dcls='/data/scripts/docker_clean.sh \$1'
alias dlog='/data/scripts/docker_login.sh \$1'
alias drun='/data/scripts/docker_run.sh'
alias health='/data/scripts/docker_health.sh'
EOL
}

# get_sdc_images() - Function that retrieves the SDC docker images
function get_sdc_images {
    build_docker_image ${src_folders[sdc]}/sdc-docker-base
    build_docker_image ${src_folders[sdc]}/utils/webseal-simulator docker
    if [[ "$build_image" == "True" ]]; then
        compile_src  ${src_folders[sdc]}
        for project in catalog-fe test-apis-ci; do
            compile_src  ${src_folders[sdc]}/$project
        done
        build_docker_image ${src_folders[sdc]}/sdc-os-chef docker
    else
        for image in elasticsearch init-elasticsearch cassandra kibana backend frontend sanity; do
            pull_onap_image sdc-$image &
        done
        wait_docker_pull
    fi
}

# install_sdc() - Function that pull templates and executes
function install_sdc {
    local ENV_NAME=$dmaap_topic
    local MR_IP_ADDR='10.0.11.1'

    pushd ${src_folders[sdc]}/utils/webseal-simulator
    bash scripts/simulator_docker_run.sh
    popd

    _init_data_folders
    cp ${src_folders[sdc]}/sdc-os-chef/environments/Template.json /data/environments
    cp ${src_folders[sdc]}/sdc-os-chef/scripts/docker_run.sh /data/scripts
    cp ${src_folders[sdc]}/sdc-os-chef/scripts/docker_health.sh /data/scripts
    cp ${src_folders[sdc]}/sdc-os-chef/scripts/docker_login.sh /data/scripts
    cp ${src_folders[sdc]}/sdc-os-chef/scripts/docker_clean.sh /data/scripts
    cp ${src_folders[sdc]}/sdc-os-chef/scripts/simulator_docker_run.sh /data/scripts

    chmod +x /data/scripts/*.sh

    cat /data/environments/Template.json | sed "s/yyy/"$IP_ADDRESS"/g" > /data/environments/$ENV_NAME.json
    sed -i "s/xxx/"$ENV_NAME"/g" /data/environments/$ENV_NAME.json
    sed -i "s/\"ueb_url_list\":.*/\"ueb_url_list\": \""$MR_IP_ADDR","$MR_IP_ADDR"\",/g" /data/environments/$ENV_NAME.json
    sed -i "s/\"fqdn\":.*/\"fqdn\": [\""$MR_IP_ADDR"\", \""$MR_IP_ADDR"\"]/g" /data/environments/$ENV_NAME.json

    install_docker
    if [[ "$skip_get_images" == "False" ]]; then
        bash /data/scripts/docker_run.sh -e $ENV_NAME -l
    else
        bash /data/scripts/docker_run.sh -e $ENV_NAME -r $docker_version -p $(echo $nexus_docker_repo | cut -d':' -f2)
    fi
}

# init_sdc() - Function that initialize SDC services
function init_sdc {
    mount_external_partition sdb /data/
    if [[ "$clone_repo" == "True" ]]; then
        clone_repos "sdc"
        if [[ "$compile_repo" == "True" ]]; then
            compile_repos "sdc"
        fi
    fi

    if [[ "$skip_get_images" == "False" ]]; then
        get_sdc_images
    fi
    if [[ "$skip_install" == "False" ]]; then
        install_sdc
    fi
    _setup_docker_aliases
}
