diff options
Diffstat (limited to 'lib/multicloud')
-rwxr-xr-x | lib/multicloud | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/multicloud b/lib/multicloud new file mode 100755 index 0000000..ff6f970 --- /dev/null +++ b/lib/multicloud @@ -0,0 +1,51 @@ +#!/bin/bash + +source /var/onap/functions + +openstack_release="newton" + +# _build_multicloud_images() - Function that builds docker images from source code +function _build_multicloud_images { + install_docker + pushd ${src_folders[multicloud]}/openstack/$openstack_release + install_python_requirements . + python setup.py develop + #bash build_image.sh + popd +} + +# get_multicloud_images() - +function get_multicloud_images { + if [[ "$build_image" == "True" ]]; then + _build_multicloud_images + else + pull_onap_image multicloud/openstack-$openstack_release + fi +} + +# install_multicloud() - +function install_multicloud { + #run_docker_compose ${src_folders[multicloud]}/openstack/$openstack_release + if [[ "$build_image" == "True" ]]; then + multicloud-api --port 9003 --host 0.0.0.0 & + else + docker_id=`docker images | grep onap/multicloud/openstack-$openstack_release | grep latest | awk '{print $3; exit}'` + docker run -d -p 0.0.0.0:9003:9003 $docker_id + fi +} + +# init_multicloud() - Function that initialize Multi Cloud services +function init_multicloud { + if [[ "$clone_repo" == "True" ]]; then + clone_repos "multicloud" + if [[ "$compile_repo" == "True" ]]; then + compile_repos "multicloud" + fi + fi + if [[ "$skip_get_images" == "False" ]]; then + get_multicloud_images + if [[ "$skip_install" == "False" ]]; then + install_multicloud + fi + fi +} |