blob: 8ad73561f6fc11c5eca2a6c487f2e3598ba4a2b7 [file] [log] [blame]
Victor Morales89ce3212017-06-16 18:32:48 -05001#!/bin/bash
2
3set -o xtrace
4
5source /var/onap/sdnc
Victor Moralesdd074802017-07-26 16:06:35 -05006source /var/onap/asserts
7
8# clone_all_appc_repos() - Function that clones APPC source repo.
9function clone_all_appc_repos {
10 local src_folder=/opt/appc
11
12 clone_repo appc $src_folder
13 clone_repo appc/deployment $src_folder/deployment
14}
15
16# compile_all_appc_repos() - Function that compiles APPC source repo.
17function compile_all_appc_repos {
18 local src_folder=/opt/appc
19
20 compile_src $src_folder
21 compile_src $src_folder/deployment
22}
Victor Morales89ce3212017-06-16 18:32:48 -050023
24# install_appc() - Function that clones and installs the APPC services from source code
25function install_appc {
Victor Moralesdd074802017-07-26 16:06:35 -050026 install_package unzip
Victor Morales89ce3212017-06-16 18:32:48 -050027 local src_folder=/opt/appc
Victor Moralesdd074802017-07-26 16:06:35 -050028
29 clone_all_appc_repos
30 if [[ "$compile_repo" == "True" ]]; then
31 compile_all_appc_repos
32 fi
33
Victor Morales89ce3212017-06-16 18:32:48 -050034 if [[ "$build_image" == "True" ]]; then
Victor Moralesdd074802017-07-26 16:06:35 -050035 clone_repo sdnc/oam /opt/sdnc/oam
36 build_sdnc_images /opt/sdnc/oam
Victor Morales89ce3212017-06-16 18:32:48 -050037 build_docker_image $src_folder/deployment/installation/appc docker
Victor Moralesdd074802017-07-26 16:06:35 -050038 asserts_image openecomp/appc-image
Victor Morales89ce3212017-06-16 18:32:48 -050039 else
40 pull_openecomp_image appc-image openecomp/appc-image:latest
41 pull_openecomp_image dgbuilder-sdnc-image openecomp/dgbuilder-sdnc-image:latest
42 fi
Victor Moralesdd074802017-07-26 16:06:35 -050043 pushd $src_folder/deployment
Victor Morales89ce3212017-06-16 18:32:48 -050044 install_docker_compose
45 /opt/docker/docker-compose up -d
46 popd
47}
48
49# init_appc() - Function that initialize APPC services
50function init_appc {
51 install_appc
52}