blob: ff6f9708c065ce02e8ed7959ed2937055446ce26 [file] [log] [blame]
Victor Morales000de532017-08-31 17:28:10 -05001#!/bin/bash
2
Victor Morales000de532017-08-31 17:28:10 -05003source /var/onap/functions
4
Victor Morales88d193e2017-11-16 10:50:28 -08005openstack_release="newton"
Victor Morales000de532017-08-31 17:28:10 -05006
Victor Morales71f7d292018-01-04 16:27:07 -08007# _build_multicloud_images() - Function that builds docker images from source code
8function _build_multicloud_images {
Victor Morales88d193e2017-11-16 10:50:28 -08009 install_docker
Victor Morales71f7d292018-01-04 16:27:07 -080010 pushd ${src_folders[multicloud]}/openstack/$openstack_release
11 install_python_requirements .
12 python setup.py develop
13 #bash build_image.sh
Victor Morales88d193e2017-11-16 10:50:28 -080014 popd
15}
16
Victor Morales6a919972017-09-28 18:29:54 -070017# get_multicloud_images() -
18function get_multicloud_images {
Victor Morales88d193e2017-11-16 10:50:28 -080019 if [[ "$build_image" == "True" ]]; then
Victor Morales71f7d292018-01-04 16:27:07 -080020 _build_multicloud_images
Victor Morales88d193e2017-11-16 10:50:28 -080021 else
22 pull_onap_image multicloud/openstack-$openstack_release
23 fi
Victor Morales6a919972017-09-28 18:29:54 -070024}
25
Victor Morales000de532017-08-31 17:28:10 -050026# install_multicloud() -
27function install_multicloud {
Victor Morales96fe3882018-03-02 14:08:39 -080028 #run_docker_compose ${src_folders[multicloud]}/openstack/$openstack_release
Victor Morales71f7d292018-01-04 16:27:07 -080029 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 Morales000de532017-08-31 17:28:10 -050035}
36
37# init_multicloud() - Function that initialize Multi Cloud services
38function init_multicloud {
39 if [[ "$clone_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080040 clone_repos "multicloud"
Victor Morales000de532017-08-31 17:28:10 -050041 if [[ "$compile_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080042 compile_repos "multicloud"
Victor Morales000de532017-08-31 17:28:10 -050043 fi
44 fi
Victor Morales6a919972017-09-28 18:29:54 -070045 if [[ "$skip_get_images" == "False" ]]; then
46 get_multicloud_images
47 if [[ "$skip_install" == "False" ]]; then
48 install_multicloud
49 fi
50 fi
Victor Morales000de532017-08-31 17:28:10 -050051}