blob: d2b09f2aa432c34e565c240b29ad4682065f3173 [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 Morales71f7d292018-01-04 16:27:07 -080028 #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 Morales000de532017-08-31 17:28:10 -050037}
38
39# init_multicloud() - Function that initialize Multi Cloud services
40function init_multicloud {
41 if [[ "$clone_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080042 clone_repos "multicloud"
Victor Morales000de532017-08-31 17:28:10 -050043 if [[ "$compile_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080044 compile_repos "multicloud"
Victor Morales000de532017-08-31 17:28:10 -050045 fi
46 fi
Victor Morales6a919972017-09-28 18:29:54 -070047 if [[ "$skip_get_images" == "False" ]]; then
48 get_multicloud_images
49 if [[ "$skip_install" == "False" ]]; then
50 install_multicloud
51 fi
52 fi
Victor Morales000de532017-08-31 17:28:10 -050053}