blob: ea7fa3332c00c7856616be32616869a6f12d1110 [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
Victor Moralesf8730f52018-03-02 13:24:33 -08008 pushd ${src_folders[vnfsdk]}/refrepo/vnfmarket-be/deployment/docker/docker-refrepo
Shashank Kumar Shankard52d0af2017-10-20 16:06:08 -07009 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
Victor Moralesf8730f52018-03-02 13:24:33 -080027 pushd ${src_folders[vnfsdk]}/refrepo/vnfmarket-be/deployment/install
Shashank Kumar Shankard52d0af2017-10-20 16:06:08 -070028 /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}