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 | |
Victor Morales | 88d193e | 2017-11-16 10:50:28 -0800 | [diff] [blame] | 5 | openstack_release="newton" |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 6 | |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 7 | # _build_images() - Function that builds docker images from source code |
Victor Morales | 88d193e | 2017-11-16 10:50:28 -0800 | [diff] [blame] | 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 | |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 16 | # get_multicloud_images() - |
| 17 | function get_multicloud_images { |
Victor Morales | 88d193e | 2017-11-16 10:50:28 -0800 | [diff] [blame] | 18 | if [[ "$build_image" == "True" ]]; then |
| 19 | _build_images |
| 20 | else |
| 21 | pull_onap_image multicloud/openstack-$openstack_release |
| 22 | fi |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 23 | } |
| 24 | |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 25 | # install_multicloud() - |
| 26 | function install_multicloud { |
Victor Morales | 88d193e | 2017-11-16 10:50:28 -0800 | [diff] [blame] | 27 | pushd $multicloud_src_folder/openstack/$openstack_release |
| 28 | /opt/docker/docker-compose up -d |
| 29 | popd |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | # init_multicloud() - Function that initialize Multi Cloud services |
| 33 | function init_multicloud { |
| 34 | if [[ "$clone_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 35 | clone_repos "multicloud" |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 36 | if [[ "$compile_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 37 | compile_repos "multicloud" |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 38 | fi |
| 39 | fi |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 40 | if [[ "$skip_get_images" == "False" ]]; then |
| 41 | get_multicloud_images |
| 42 | if [[ "$skip_install" == "False" ]]; then |
| 43 | install_multicloud |
| 44 | fi |
| 45 | fi |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 46 | } |