#!/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]}/utils/webseal-simulator docker
    if [[ "$build_image" == "True" ]]; then
        build_docker_image ${src_folders[sdc]}/sdc-docker-base
        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'

    _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
}
