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 | 71f7d29 | 2018-01-04 16:27:07 -0800 | [diff] [blame] | 28 | #pushd ${src_folders[multicloud]}/openstack/$openstack_release |
| 29 | #/opt/docker/docker-compose up -d |
| 30 | #popd |
| 31 | if [[ "$build_image" == "True" ]]; then |
| 32 | multicloud-api --port 9003 --host 0.0.0.0 & |
| 33 | else |
| 34 | docker_id=`docker images | grep onap/multicloud/openstack-$openstack_release | grep latest | awk '{print $3; exit}'` |
| 35 | docker run -d -p 0.0.0.0:9003:9003 $docker_id |
| 36 | fi |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | # init_multicloud() - Function that initialize Multi Cloud services |
| 40 | function init_multicloud { |
| 41 | if [[ "$clone_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 42 | clone_repos "multicloud" |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 43 | if [[ "$compile_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 44 | compile_repos "multicloud" |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 45 | fi |
| 46 | fi |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 47 | if [[ "$skip_get_images" == "False" ]]; then |
| 48 | get_multicloud_images |
| 49 | if [[ "$skip_install" == "False" ]]; then |
| 50 | install_multicloud |
| 51 | fi |
| 52 | fi |
Victor Morales | 000de53 | 2017-08-31 17:28:10 -0500 | [diff] [blame] | 53 | } |