Victor Morales | 9d205bc | 2017-12-01 17:52:07 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | source /var/onap/functions |
| 4 | |
Victor Morales | 9d205bc | 2017-12-01 17:52:07 -0800 | [diff] [blame] | 5 | # _build_msb_images() - Function that creates Microservices Docker images from source code |
| 6 | function _build_msb_images { |
| 7 | if [[ "$compile_repo" != "True" ]]; then |
| 8 | compile_repos "msb" |
| 9 | fi |
| 10 | |
Victor Morales | f8730f5 | 2018-03-02 13:24:33 -0800 | [diff] [blame] | 11 | 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 Morales | 9d205bc | 2017-12-01 17:52:07 -0800 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | # get_msb_images() - Function that retrieves the Microservices Bus images |
| 17 | function 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 Morales | f8730f5 | 2018-03-02 13:24:33 -0800 | [diff] [blame] | 23 | for image in base apigateway discovery; do |
| 24 | pull_onap_image msb/msb_$image |
| 25 | done |
Victor Morales | 9d205bc | 2017-12-01 17:52:07 -0800 | [diff] [blame] | 26 | fi |
| 27 | } |
| 28 | |
| 29 | # install_msb() - Downloads and configure Microservices Bus source code |
| 30 | function 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 |
| 37 | function 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 | } |