blob: a14e8ea6c46137c78ad31468c7ee28c8f80e551b [file] [log] [blame]
Victor Morales9d205bc2017-12-01 17:52:07 -08001#!/bin/bash
2
3source /var/onap/functions
4
Victor Morales9d205bc2017-12-01 17:52:07 -08005# _build_msb_images() - Function that creates Microservices Docker images from source code
6function _build_msb_images {
7 if [[ "$compile_repo" != "True" ]]; then
8 compile_repos "msb"
9 fi
10
11 build_docker_image $msb_src_folder/apigateway/distributions/msb-apigateway/src/main/basedocker onap/msb/msb_base
12 build_docker_image $msb_src_folder/apigateway/distributions/msb-apigateway/src/main/docker onap/msb/msb_apigateway
13 build_docker_image $msb_src_folder/discovery/distributions/msb-discovery/src/main/docker onap/msb/msb_discovery
14}
15
16# get_msb_images() - Function that retrieves the Microservices Bus images
17function get_msb_images {
18 pull_docker_image "consul:0.9.3"
19 if [[ "$build_image" == "True" ]]; then
20 _build_msb_images
21 else
22 unset docker_version
23 pull_onap_image msb/msb_base
24 pull_onap_image msb/msb_apigateway
25 pull_onap_image msb/msb_discovery
26 fi
27}
28
29# install_msb() - Downloads and configure Microservices Bus source code
30function install_msb {
31 run_docker_image -d --net=host --name msb_consul consul:0.9.3
32 run_docker_image -d --net=host --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery
33 run_docker_image -d --net=host -e "ROUTE_LABELS=visualRange:1" --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway
34}
35
36# init_msb() - Function that initialize Message Router services
37function init_msb {
38 if [[ "$clone_repo" == "True" ]]; then
39 clone_repos "msb"
40 if [[ "$compile_repo" == "True" ]]; then
41 compile_repos "msb"
42 fi
43 fi
44 if [[ "$skip_get_images" == "False" ]]; then
45 get_msb_images
46 if [[ "$skip_install" == "False" ]]; then
47 install_msb
48 fi
49 fi
50}