#!/bin/bash

source /var/onap/functions

# 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 ${src_folders[mso]}
        build_docker_image ${src_folders[mso]}/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 ${src_folders[mso]}/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
}
