377d4dcd73dd8151e486613f24aff67397ae961f
[integration.git] / bootstrap / vagrant-onap / lib / multicloud
1 #!/bin/bash
2
3 source /var/onap/functions
4
5 openstack_release="newton"
6
7 # _build_images() - Function that builds docker images from source code
8 function _build_images {
9     install_docker
10     install_python_requirements $multicloud_src_folder/openstack/$openstack_release
11     pushd $multicloud_src_folder/openstack/$openstack_release
12     bash build_image.sh
13     popd
14 }
15
16 # get_multicloud_images() -
17 function get_multicloud_images {
18     if [[ "$build_image" == "True" ]]; then
19         _build_images
20     else
21         pull_onap_image multicloud/openstack-$openstack_release
22     fi
23 }
24
25 # install_multicloud() - 
26 function install_multicloud {
27     pushd $multicloud_src_folder/openstack/$openstack_release
28     /opt/docker/docker-compose up -d
29     popd
30 }
31
32 # init_multicloud() - Function that initialize Multi Cloud services
33 function init_multicloud {
34     if [[ "$clone_repo" == "True" ]]; then
35         clone_repos "multicloud"
36         if [[ "$compile_repo" == "True" ]]; then
37             compile_repos "multicloud"
38         fi
39     fi
40     if [[ "$skip_get_images" == "False" ]]; then
41         get_multicloud_images
42         if [[ "$skip_install" == "False" ]]; then
43             install_multicloud
44         fi
45     fi
46 }