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 | 71f7d29 | 2018-01-04 16:27:07 -0800 | [diff] [blame] | 7 | # _build_multicloud_images() - Function that builds docker images from source code |
| 8 | function _build_multicloud_images { |
Victor Morales | 88d193e | 2017-11-16 10:50:28 -0800 | [diff] [blame] | 9 | install_docker |
Victor Morales | 71f7d29 | 2018-01-04 16:27:07 -0800 | [diff] [blame] | 10 | pushd ${src_folders[multicloud]}/openstack/$openstack_release |
| 11 | install_python_requirements . |
| 12 | python setup.py develop |
| 13 | #bash build_image.sh |
Victor Morales | 88d193e | 2017-11-16 10:50:28 -0800 | [diff] [blame] | 14 | popd |
| 15 | } |
| 16 | |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 17 | # get_multicloud_images() - |
| 18 | function get_multicloud_images { |
Victor Morales | 88d193e | 2017-11-16 10:50:28 -0800 | [diff] [blame] | 19 | if [[ "$build_image" == "True" ]]; then |
Victor Morales | 71f7d29 | 2018-01-04 16:27:07 -0800 | [diff] [blame] | 20 | _build_multicloud_images |
Victor Morales | 88d193e | 2017-11-16 10:50:28 -0800 | [diff] [blame] | 21 | else |
| 22 | pull_onap_image multicloud/openstack-$openstack_release |
| 23 | fi |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 24 | } |
| 25 | |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 26 | # install_multicloud() - |
| 27 | function install_multicloud { |
Victor Morales | 96fe388 | 2018-03-02 14:08:39 -0800 | [diff] [blame] | 28 | #run_docker_compose ${src_folders[multicloud]}/openstack/$openstack_release |
Victor Morales | 71f7d29 | 2018-01-04 16:27:07 -0800 | [diff] [blame] | 29 | if [[ "$build_image" == "True" ]]; then |
| 30 | multicloud-api --port 9003 --host 0.0.0.0 & |
| 31 | else |
| 32 | docker_id=`docker images | grep onap/multicloud/openstack-$openstack_release | grep latest | awk '{print $3; exit}'` |
| 33 | docker run -d -p 0.0.0.0:9003:9003 $docker_id |
| 34 | fi |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | # init_multicloud() - Function that initialize Multi Cloud services |
| 38 | function init_multicloud { |
| 39 | if [[ "$clone_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 40 | clone_repos "multicloud" |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 41 | if [[ "$compile_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 42 | compile_repos "multicloud" |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 43 | fi |
| 44 | fi |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 45 | if [[ "$skip_get_images" == "False" ]]; then |
| 46 | get_multicloud_images |
| 47 | if [[ "$skip_install" == "False" ]]; then |
| 48 | install_multicloud |
| 49 | fi |
| 50 | fi |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 51 | } |