blob: a0959c67a735ae01f67244219ce2574c1654d16d [file] [log] [blame]
Victor Morales89ce3212017-06-16 18:32:48 -05001#!/bin/bash
2
3set -o xtrace
4
5source /var/onap/sdnc
Victor Morales65deef22017-08-18 20:53:42 -05006source /var/onap/functions
7
8appc_src_folder=$git_src_folder/appc
Victor Moralesdd074802017-07-26 16:06:35 -05009
10# clone_all_appc_repos() - Function that clones APPC source repo.
11function clone_all_appc_repos {
Victor Morales65deef22017-08-18 20:53:42 -050012 clone_repo appc $appc_src_folder
13 clone_repo appc/deployment $appc_src_folder/deployment
Victor Moralesdd074802017-07-26 16:06:35 -050014}
15
16# compile_all_appc_repos() - Function that compiles APPC source repo.
17function compile_all_appc_repos {
Victor Morales65deef22017-08-18 20:53:42 -050018 compile_src $appc_src_folder
19 compile_src $appc_src_folder/deployment
Victor Moralesdd074802017-07-26 16:06:35 -050020}
Victor Morales89ce3212017-06-16 18:32:48 -050021
Victor Morales65deef22017-08-18 20:53:42 -050022# _build_appc_images() - Function that creates APPC images from source code.
23function _build_appc_images {
24 get_sdnc_images
25 build_docker_image $appc_src_folder/deployment/installation/appc docker
26}
Victor Moralesdd074802017-07-26 16:06:35 -050027
Victor Morales65deef22017-08-18 20:53:42 -050028# get_appc_images() - Function that gets or build APPC docker images
29function get_appc_images {
Victor Morales89ce3212017-06-16 18:32:48 -050030 if [[ "$build_image" == "True" ]]; then
Victor Morales65deef22017-08-18 20:53:42 -050031 _build_appc_images
Victor Morales89ce3212017-06-16 18:32:48 -050032 else
33 pull_openecomp_image appc-image openecomp/appc-image:latest
34 pull_openecomp_image dgbuilder-sdnc-image openecomp/dgbuilder-sdnc-image:latest
35 fi
Victor Morales65deef22017-08-18 20:53:42 -050036}
37
38# install_appc() - Function that clones and installs the APPC services from source code
39function install_appc {
40 pushd $appc_src_folder/deployment/docker-compose
Victor Morales89ce3212017-06-16 18:32:48 -050041 install_docker_compose
42 /opt/docker/docker-compose up -d
43 popd
44}
45
46# init_appc() - Function that initialize APPC services
47function init_appc {
Victor Morales65deef22017-08-18 20:53:42 -050048 clone_all_appc_repos
49 if [[ "$compile_repo" == "True" ]]; then
50 compile_all_appc_repos
51 fi
52
53 get_appc_images
Victor Morales89ce3212017-06-16 18:32:48 -050054 install_appc
55}