blob: 14ba3cf96d4689ac76569389cabeed6c2a87bb30 [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
6appc_src_folder=$git_src_folder/appc
Victor Morales21404d72017-10-20 13:18:26 -07007appc_repos=("appc" "appc/deployment")
Victor Moralesdd074802017-07-26 16:06:35 -05008
Victor Morales65deef22017-08-18 20:53:42 -05009# _build_appc_images() - Function that creates APPC images from source code.
10function _build_appc_images {
11 get_sdnc_images
12 build_docker_image $appc_src_folder/deployment/installation/appc docker
13}
Victor Moralesdd074802017-07-26 16:06:35 -050014
Victor Morales65deef22017-08-18 20:53:42 -050015# get_appc_images() - Function that gets or build APPC docker images
16function get_appc_images {
Victor Morales89ce3212017-06-16 18:32:48 -050017 if [[ "$build_image" == "True" ]]; then
Victor Morales65deef22017-08-18 20:53:42 -050018 _build_appc_images
Victor Morales89ce3212017-06-16 18:32:48 -050019 else
20 pull_openecomp_image appc-image openecomp/appc-image:latest
21 pull_openecomp_image dgbuilder-sdnc-image openecomp/dgbuilder-sdnc-image:latest
22 fi
Victor Morales65deef22017-08-18 20:53:42 -050023}
24
25# install_appc() - Function that clones and installs the APPC services from source code
26function install_appc {
27 pushd $appc_src_folder/deployment/docker-compose
Victor Morales89ce3212017-06-16 18:32:48 -050028 install_docker_compose
29 /opt/docker/docker-compose up -d
30 popd
31}
32
33# init_appc() - Function that initialize APPC services
34function init_appc {
Idan Amit1690e082017-08-20 08:58:14 +030035 if [[ "$clone_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080036 clone_repos "appc"
Idan Amit1690e082017-08-20 08:58:14 +030037 if [[ "$compile_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080038 compile_repos "appc"
Idan Amit1690e082017-08-20 08:58:14 +030039 fi
Victor Morales65deef22017-08-18 20:53:42 -050040 fi
41
Victor Morales6a919972017-09-28 18:29:54 -070042 if [[ "$skip_get_images" == "False" ]]; then
43 get_appc_images
44 if [[ "$skip_install" == "False" ]]; then
45 install_appc
46 fi
47 fi
Victor Morales89ce3212017-06-16 18:32:48 -050048}