blob: 2f9e5d8d89518a2aaeedc5fa471c156439bfe8e0 [file] [log] [blame]
Victor Morales000de532017-08-31 17:28:10 -05001#!/bin/bash
2
Victor Morales000de532017-08-31 17:28:10 -05003source /var/onap/functions
4
5multicloud_src_folder=$git_src_folder/multicloud
Shashank Kumar Shankarf84c9a12017-10-23 11:08:31 -07006multicloud_repos=("multicloud" "multicloud/framework" "multicloud/openstack" \
7"multicloud/openstack/vmware" "multicloud/openstack/windriver" \
8"multicloud/azure")
Victor Morales88d193e2017-11-16 10:50:28 -08009openstack_release="newton"
Victor Morales000de532017-08-31 17:28:10 -050010
11# clone_multicloud_repos() - Function that clones the Multi Cloud repositories
12function clone_multicloud_repos {
Shashank Kumar Shankarf84c9a12017-10-23 11:08:31 -070013 for repo in ${multicloud_repos[@]}; do
14 clone_repo $repo $multicloud_src_folder${repo#*multicloud}
Victor Morales000de532017-08-31 17:28:10 -050015 done
16}
17
18# compile_multicloud_repos() -
19function compile_multicloud_repos {
Shashank Kumar Shankarf84c9a12017-10-23 11:08:31 -070020 for repo in ${multicloud_repos[@]}; do
21 compile_src $multicloud_src_folder${repo#*multicloud}
Victor Morales000de532017-08-31 17:28:10 -050022 done
23}
24
Victor Morales88d193e2017-11-16 10:50:28 -080025function _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
Victor Morales6a919972017-09-28 18:29:54 -070033# get_multicloud_images() -
34function get_multicloud_images {
Victor Morales88d193e2017-11-16 10:50:28 -080035 if [[ "$build_image" == "True" ]]; then
36 _build_images
37 else
38 pull_onap_image multicloud/openstack-$openstack_release
39 fi
Victor Morales6a919972017-09-28 18:29:54 -070040}
41
Victor Morales000de532017-08-31 17:28:10 -050042# install_multicloud() -
43function install_multicloud {
Victor Morales88d193e2017-11-16 10:50:28 -080044 pushd $multicloud_src_folder/openstack/$openstack_release
45 /opt/docker/docker-compose up -d
46 popd
Victor Morales000de532017-08-31 17:28:10 -050047}
48
49# init_multicloud() - Function that initialize Multi Cloud services
50function 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
Victor Morales6a919972017-09-28 18:29:54 -070057 if [[ "$skip_get_images" == "False" ]]; then
58 get_multicloud_images
59 if [[ "$skip_install" == "False" ]]; then
60 install_multicloud
61 fi
62 fi
Victor Morales000de532017-08-31 17:28:10 -050063}