blob: ad01ca53e517c544b64422240107674d37233a89 [file] [log] [blame]
Victor Morales89ce3212017-06-16 18:32:48 -05001#!/bin/bash
2
Victor Morales89ce3212017-06-16 18:32:48 -05003source /var/onap/sdnc
Victor Morales65deef22017-08-18 20:53:42 -05004source /var/onap/functions
5
Victor Morales65deef22017-08-18 20:53:42 -05006# _build_appc_images() - Function that creates APPC images from source code.
7function _build_appc_images {
8 get_sdnc_images
9 build_docker_image $appc_src_folder/deployment/installation/appc docker
10}
Victor Moralesdd074802017-07-26 16:06:35 -050011
Victor Morales65deef22017-08-18 20:53:42 -050012# get_appc_images() - Function that gets or build APPC docker images
13function get_appc_images {
Victor Morales89ce3212017-06-16 18:32:48 -050014 if [[ "$build_image" == "True" ]]; then
Victor Morales65deef22017-08-18 20:53:42 -050015 _build_appc_images
Victor Morales89ce3212017-06-16 18:32:48 -050016 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
Victor Morales65deef22017-08-18 20:53:42 -050020}
21
22# install_appc() - Function that clones and installs the APPC services from source code
23function install_appc {
24 pushd $appc_src_folder/deployment/docker-compose
Victor Morales89ce3212017-06-16 18:32:48 -050025 install_docker_compose
26 /opt/docker/docker-compose up -d
27 popd
28}
29
30# init_appc() - Function that initialize APPC services
31function init_appc {
Idan Amit1690e082017-08-20 08:58:14 +030032 if [[ "$clone_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080033 clone_repos "appc"
Idan Amit1690e082017-08-20 08:58:14 +030034 if [[ "$compile_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080035 compile_repos "appc"
Idan Amit1690e082017-08-20 08:58:14 +030036 fi
Victor Morales65deef22017-08-18 20:53:42 -050037 fi
38
Victor Morales6a919972017-09-28 18:29:54 -070039 if [[ "$skip_get_images" == "False" ]]; then
40 get_appc_images
41 if [[ "$skip_install" == "False" ]]; then
42 install_appc
43 fi
44 fi
Victor Morales89ce3212017-06-16 18:32:48 -050045}