Centralize src_folder and repos info
[integration.git] / bootstrap / vagrant-onap / lib / appc
1 #!/bin/bash
2
3 source /var/onap/sdnc
4 source /var/onap/functions
5
6 # _build_appc_images() - Function that creates APPC images from source code.
7 function _build_appc_images {
8     get_sdnc_images
9     build_docker_image $appc_src_folder/deployment/installation/appc docker
10 }
11
12 # get_appc_images() - Function that gets or build APPC docker images
13 function get_appc_images {
14     if [[ "$build_image" == "True" ]]; then
15         _build_appc_images
16     else
17         pull_openecomp_image appc-image openecomp/appc-image:latest
18         pull_openecomp_image dgbuilder-sdnc-image openecomp/dgbuilder-sdnc-image:latest
19     fi
20 }
21
22 # install_appc() - Function that clones and installs the APPC services from source code
23 function install_appc {
24     pushd $appc_src_folder/deployment/docker-compose
25     install_docker_compose
26     /opt/docker/docker-compose up -d
27     popd
28 }
29
30 # init_appc() - Function that initialize APPC services
31 function init_appc {
32     if [[ "$clone_repo" == "True" ]]; then
33         clone_repos "appc"
34         if [[ "$compile_repo" == "True" ]]; then
35             compile_repos "appc"
36         fi
37     fi
38
39     if [[ "$skip_get_images" == "False" ]]; then
40         get_appc_images
41         if [[ "$skip_install" == "False" ]]; then
42             install_appc
43         fi
44     fi
45 }