blob: 58e3a9aa27cfa8fa6c32f02569bbebe918302e0a [file] [log] [blame]
Shashank Kumar Shankard52d0af2017-10-20 16:06:08 -07001#!/bin/bash
2
Shashank Kumar Shankard52d0af2017-10-20 16:06:08 -07003source /var/onap/functions
4
Shashank Kumar Shankard52d0af2017-10-20 16:06:08 -07005# _build_vnfsdk_images() - Builds VNFSDK images from source code
6function _build_vnfsdk_images {
7 install_package unzip
8 pushd $vnfsdk_src_folder/refrepo/vnfmarket-be/deployment/docker/docker-refrepo
9 build_docker_image .
10 popd
11}
12
13# get_vnfsdk_images - Function that clones vnfsdk Docker images
14function get_vnfsdk_images {
15 if [[ "$build_image" == "True" ]]; then
16 # TODO(sshank): Has errors building.
17 _build_vnfsdk_images
18 else
19 pull_docker_image refrepo:1.0-STAGING-latest
20 pull_docker_image refrepo:latest
21 fi
22}
23
24# install_vnfsdk - Function that installs vnfsdk Docker images
25function install_vnfsdk {
26 install_docker_compose
27 pushd $vnfsdk_src_folder/refrepo/vnfmarket-be/deployment/install
28 /opt/docker/docker-compose up -d
29 popd
30}
31
32# init_vnfsdk() - Init VNFSDK services
33function init_vnfsdk {
34 if [[ "$clone_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080035 clone_repos "vnfsdk"
Shashank Kumar Shankard52d0af2017-10-20 16:06:08 -070036 if [[ "$compile_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080037 compile_repos "vnfsdk"
Shashank Kumar Shankard52d0af2017-10-20 16:06:08 -070038 fi
39 fi
40
41 if [[ "$skip_get_images" == "False" ]]; then
42 get_vnfsdk_images
43 if [[ "$skip_install" == "False" ]]; then
44 install_vnfsdk
45 fi
46 fi
47}