#!/bin/bash

source /var/onap/functions

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

# get_mso_images() - Function that retrieves or create MSO Docker images
function get_mso_images {
    if [[ "$build_image" == "True" ]]; then
        export GIT_NO_PROJECT=/opt/
        compile_src $mso_src_folder
        build_docker_image $mso_src_folder/packages/docker docker
    fi
}

# install_mso() - Install MSO Docker configuration project
function install_mso {
    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

    install_docker
    install_docker_compose
    # Deploy the environment
    pushd $mso_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_repos "mso"
        if [[ "$compile_repo" == "True" ]]; then
            compile_repos "mso"
        fi
    fi

    if [[ "$skip_get_images" == "False" ]]; then
        get_mso_images
        if [[ "$skip_install" == "False" ]]; then
            install_mso
        fi
    fi
}
