aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dmaap
blob: 3462a8f265e88e9db00878d68390818a5695a5df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2017-2018
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
#############################################################################

source /var/onap/functions

# _build_dmaap_images() - Build DMaaP Docker images from source code
function _build_dmaap_images {
    if [[ "$compile_repo" != "True" ]]; then
        compile_repos "dmaap"
    fi
    for project in buscontroller datarouter/datarouter-node datarouter/datarouter-prov messagerouter/messageservice; do
        build_docker_image ${src_folders[dmaap]}/$project
    done
}

# get_dmaap_images() - Get DMaaP Docker images
function get_dmaap_images {
    if [[ "$build_image" == "True" ]]; then
        _build_dmaap_images
    else
        for image in dmaap-mr datarouter-prov datarouter-node buscontroller; do
            pull_onap_image dmaap/$image
        done
    fi
}

# install_dmaap() - Install DMaaP services
function install_dmaap {
    cp ${src_folders[dmaap]}/messagerouter//messageservice/bundleconfig-local/etc/appprops/MsgRtrApi.properties /var/tmp/
    sed -i "s|config.zk.servers=<zookeeper_host>|config.zk.servers=172.18.0.3|g" /var/tmp/MsgRtrApi.properties
    sed -i "s|kafka.metadata.broker.list=<kafka_host>:<kafka_port>|kafka.metadata.broker.list=172.18.0.2:9092|g" /var/tmp/MsgRtrApi.properties
    run_docker_compose ${src_folders[dmaap]}/messagerouter/messageservice/src/main/resources/docker-compose/
    run_docker_compose ${src_folders[dmaap]}/datarouter/datarouter-prov/src/main/resources/docker-compose/
}

# init_dmaap() - Function that initialize DMaaP service
function init_dmaap {
    if [[ "$clone_repo" == "True" ]]; then
        clone_repos "dmaap"
        if [[ "$compile_repo" == "True" ]]; then
            compile_repos "dmaap"
        fi
    fi
    if [[ "$skip_get_images" == "False" ]]; then
        get_dmaap_images
    fi
    if [[ "$skip_install" == "False" ]]; then
        install_dmaap
    fi
}