blob: bcf27fe754c66152da19ea704ea9e28475ccc78d [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
Victor Moralesf8730f52018-03-02 13:24:33 -080011 build_docker_image ${src_folders[msb]}/apigateway/distributions/msb-apigateway/src/main/basedocker onap/msb/msb_base
12 build_docker_image ${src_folders[msb]}/apigateway/distributions/msb-apigateway/src/main/docker onap/msb/msb_apigateway
13 build_docker_image ${src_folders[msb]}/discovery/distributions/msb-discovery/src/main/docker onap/msb/msb_discovery
Victor Morales9d205bc2017-12-01 17:52:07 -080014}
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
Victor Moralesf8730f52018-03-02 13:24:33 -080023 for image in base apigateway discovery; do
24 pull_onap_image msb/msb_$image
25 done
Victor Morales9d205bc2017-12-01 17:52:07 -080026 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}