#!/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 $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
}
