Implement steps for Multicloud Images
[integration.git] / bootstrap / vagrant-onap / lib / multicloud
1 #!/bin/bash
2
3 source /var/onap/functions
4
5 multicloud_src_folder=$git_src_folder/multicloud
6 multicloud_repos=("multicloud" "multicloud/framework" "multicloud/openstack" \
7 "multicloud/openstack/vmware" "multicloud/openstack/windriver" \
8 "multicloud/azure")
9 openstack_release="newton"
10
11 # clone_multicloud_repos() - Function that clones the Multi Cloud repositories
12 function clone_multicloud_repos {
13     for repo in ${multicloud_repos[@]}; do
14         clone_repo $repo $multicloud_src_folder${repo#*multicloud}
15     done
16 }
17
18 # compile_multicloud_repos() - 
19 function compile_multicloud_repos {
20     for repo in ${multicloud_repos[@]}; do
21         compile_src $multicloud_src_folder${repo#*multicloud}
22     done
23 }
24
25 function _build_images {
26     install_docker
27     install_python_requirements $multicloud_src_folder/openstack/$openstack_release
28     pushd $multicloud_src_folder/openstack/$openstack_release
29     bash build_image.sh
30     popd
31 }
32
33 # get_multicloud_images() -
34 function get_multicloud_images {
35     if [[ "$build_image" == "True" ]]; then
36         _build_images
37     else
38         pull_onap_image multicloud/openstack-$openstack_release
39     fi
40 }
41
42 # install_multicloud() - 
43 function install_multicloud {
44     pushd $multicloud_src_folder/openstack/$openstack_release
45     /opt/docker/docker-compose up -d
46     popd
47 }
48
49 # init_multicloud() - Function that initialize Multi Cloud services
50 function init_multicloud {
51     if [[ "$clone_repo" == "True" ]]; then
52         clone_multicloud_repos
53         if [[ "$compile_repo" == "True" ]]; then
54             compile_multicloud_repos
55         fi
56     fi
57     if [[ "$skip_get_images" == "False" ]]; then
58         get_multicloud_images
59         if [[ "$skip_install" == "False" ]]; then
60             install_multicloud
61         fi
62     fi
63 }