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