#!/bin/bash

set -o xtrace

source /var/onap/functions

src_folder=$git_src_folder/mso
mso_repos=("chef-repo" "docker-config" "libs" "mso-config")

# clone_all_mso_repos() - Function that clones MSO source repo.
function clone_all_mso_repos {
    clone_repo mso $src_folder

    for dirc in ${mso_repos[@]}; do
        clone_repo mso/$dirc $src_folder/$dirc
    done
}

# compile_all_mso_repos() - Function that compiles MSO source repo.
function compile_all_mso_repos {
    compile_src $src_folder

    for dirc in ${mso_repos[@]}; do
        compile_src $src_folder/$dirc
    done
}

# install_mso() - Installation of mso images
function install_mso {
    if [[ "$build_image" == "True" ]]; then
        export GIT_NO_PROJECT=/opt/
        compile_src $src_folder
        build_docker_image $src_folder/packages/docker docker
    fi
}

# install_mso_docker_config() - Download and install MSO Docker configuration project
function install_mso_docker_config {
    MSO_ENCRYPTION_KEY=$(cat /opt/mso/docker-config/encryption.key)
    echo -n "$openstack_api_key" | openssl aes-128-ecb -e -K $MSO_ENCRYPTION_KEY -nosalt | xxd -c 256 -p > /opt/config/api_key.txt

    # Deployments in OpenStack require a keystone file
    if [ -e /opt/config/keystone.txt ]; then
        KEYSTONE_URL=$(cat /opt/config/keystone.txt)
        DCP_CLLI="DEFAULT_KEYSTONE"
        AUTH_TYPE="USERNAME_PASSWORD"
    else
        KEYSTONE_URL="https://identity.api.rackspacecloud.com/v2.0"
        DCP_CLLI="RAX_KEYSTONE"
        AUTH_TYPE="RACKSPACE_APIKEY"
    fi

    # Update the MSO configuration file.
    read -d '' MSO_CONFIG_UPDATES <<-EOF
{
"default_attributes":
    {
    "asdc-connections":
        {
            "asdc-controller1":
            {
                "environmentName": "$dmaap_topic"
            }
        },
        "mso-po-adapter-config":
        {
            "identity_services":
            [
                {
                    "dcp_clli": "$DCP_CLLI",
                    "identity_url": "$KEYSTONE_URL",
                    "mso_id": "$openstack_username",
                    "mso_pass": "$openstack_password",
                    "admin_tenant": "service",
                    "member_role": "admin",
                    "tenant_metadata": "true",
                    "identity_server_type": "KEYSTONE",
                    "identity_authentication_type": "$AUTH_TYPE"
                }
            ]
        }
    }
}
EOF
    export MSO_CONFIG_UPDATES
    export MSO_DOCKER_IMAGE_VERSION=$docker_version

    is_package_installed docker-ce || install_docker
    install_docker_compose
    # Deploy the environment
    pushd $src_folder/docker-config
    chmod +x deploy.sh
    if [[ "$build_image" == "True" ]]; then
        bash deploy.sh
    else
        # This script takes in input 2 nexus repos (the first one for the MSO image, the second one for mariadb)
        bash deploy.sh $nexus_docker_repo $nexus_username $nexus_password $nexus_docker_repo $nexus_username $nexus_password
    fi
    popd
}

# init_mso() - Function that initialize MSO services
function init_mso {
    if [[ "$clone_repo" == "True" ]]; then
        clone_all_mso_repos
        if [[ "$compile_repo" == "True" ]]; then
            compile_all_mso_repos
        fi
    fi

    install_mso
    install_mso_docker_config
}
