Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 3 | source /var/onap/functions |
| 4 | |
| 5 | multicloud_src_folder=$git_src_folder/multicloud |
Shashank Kumar Shankar | f84c9a1 | 2017-10-23 11:08:31 -0700 | [diff] [blame] | 6 | multicloud_repos=("multicloud" "multicloud/framework" "multicloud/openstack" \ |
| 7 | "multicloud/openstack/vmware" "multicloud/openstack/windriver" \ |
| 8 | "multicloud/azure") |
Victor Morales | 88d193e | 2017-11-16 10:50:28 -0800 | [diff] [blame^] | 9 | openstack_release="newton" |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 10 | |
| 11 | # clone_multicloud_repos() - Function that clones the Multi Cloud repositories |
| 12 | function clone_multicloud_repos { |
Shashank Kumar Shankar | f84c9a1 | 2017-10-23 11:08:31 -0700 | [diff] [blame] | 13 | for repo in ${multicloud_repos[@]}; do |
| 14 | clone_repo $repo $multicloud_src_folder${repo#*multicloud} |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 15 | done |
| 16 | } |
| 17 | |
| 18 | # compile_multicloud_repos() - |
| 19 | function compile_multicloud_repos { |
Shashank Kumar Shankar | f84c9a1 | 2017-10-23 11:08:31 -0700 | [diff] [blame] | 20 | for repo in ${multicloud_repos[@]}; do |
| 21 | compile_src $multicloud_src_folder${repo#*multicloud} |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 22 | done |
| 23 | } |
| 24 | |
Victor Morales | 88d193e | 2017-11-16 10:50:28 -0800 | [diff] [blame^] | 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 | |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 33 | # get_multicloud_images() - |
| 34 | function get_multicloud_images { |
Victor Morales | 88d193e | 2017-11-16 10:50:28 -0800 | [diff] [blame^] | 35 | if [[ "$build_image" == "True" ]]; then |
| 36 | _build_images |
| 37 | else |
| 38 | pull_onap_image multicloud/openstack-$openstack_release |
| 39 | fi |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 40 | } |
| 41 | |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 42 | # install_multicloud() - |
| 43 | function install_multicloud { |
Victor Morales | 88d193e | 2017-11-16 10:50:28 -0800 | [diff] [blame^] | 44 | pushd $multicloud_src_folder/openstack/$openstack_release |
| 45 | /opt/docker/docker-compose up -d |
| 46 | popd |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 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 |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 57 | if [[ "$skip_get_images" == "False" ]]; then |
| 58 | get_multicloud_images |
| 59 | if [[ "$skip_install" == "False" ]]; then |
| 60 | install_multicloud |
| 61 | fi |
| 62 | fi |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 63 | } |