5 source /var/onap/functions
7 src_folder=$git_src_folder/mso
8 mso_repos=("chef-repo" "docker-config" "libs" "mso-config")
10 # clone_all_mso_repos() - Function that clones MSO source repo.
11 function clone_all_mso_repos {
12 clone_repo mso $src_folder
14 for dirc in ${mso_repos[@]}; do
15 clone_repo mso/$dirc $src_folder/$dirc
19 # compile_all_mso_repos() - Function that compiles MSO source repo.
20 function compile_all_mso_repos {
21 compile_src $src_folder
23 for dirc in ${mso_repos[@]}; do
24 compile_src $src_folder/$dirc
28 # get_mso_images() - Function that retrieves or create MSO Docker images
29 function get_mso_images {
30 if [[ "$build_image" == "True" ]]; then
31 export GIT_NO_PROJECT=/opt/
32 compile_src $src_folder
33 build_docker_image $src_folder/packages/docker docker
37 # install_mso() - Install MSO Docker configuration project
38 function install_mso {
39 MSO_ENCRYPTION_KEY=$(cat /opt/mso/docker-config/encryption.key)
40 echo -n "$openstack_api_key" | openssl aes-128-ecb -e -K $MSO_ENCRYPTION_KEY -nosalt | xxd -c 256 -p > /opt/config/api_key.txt
42 # Deployments in OpenStack require a keystone file
43 if [ -e /opt/config/keystone.txt ]; then
44 KEYSTONE_URL=$(cat /opt/config/keystone.txt)
45 DCP_CLLI="DEFAULT_KEYSTONE"
46 AUTH_TYPE="USERNAME_PASSWORD"
48 KEYSTONE_URL="https://identity.api.rackspacecloud.com/v2.0"
49 DCP_CLLI="RAX_KEYSTONE"
50 AUTH_TYPE="RACKSPACE_APIKEY"
53 # Update the MSO configuration file.
54 read -d '' MSO_CONFIG_UPDATES <<-EOF
62 "environmentName": "$dmaap_topic"
65 "mso-po-adapter-config":
70 "dcp_clli": "$DCP_CLLI",
71 "identity_url": "$KEYSTONE_URL",
72 "mso_id": "$openstack_username",
73 "mso_pass": "$openstack_password",
74 "admin_tenant": "service",
75 "member_role": "admin",
76 "tenant_metadata": "true",
77 "identity_server_type": "KEYSTONE",
78 "identity_authentication_type": "$AUTH_TYPE"
85 export MSO_CONFIG_UPDATES
86 export MSO_DOCKER_IMAGE_VERSION=$docker_version
88 is_package_installed docker-ce || install_docker
89 install_docker_compose
90 # Deploy the environment
91 pushd $src_folder/docker-config
93 if [[ "$build_image" == "True" ]]; then
96 # This script takes in input 2 nexus repos (the first one for the MSO image, the second one for mariadb)
97 bash deploy.sh $nexus_docker_repo $nexus_username $nexus_password $nexus_docker_repo $nexus_username $nexus_password
102 # init_mso() - Function that initialize MSO services
104 if [[ "$clone_repo" == "True" ]]; then
106 if [[ "$compile_repo" == "True" ]]; then
107 compile_all_mso_repos
111 if [[ "$skip_get_images" == "False" ]]; then
113 if [[ "$skip_install" == "False" ]]; then