blob: 020d437dabe8e44b6d488b40989d92a87a7c26a3 [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
5vnfsdk_src_folder=$git_src_folder/vnfsdk
Victor Moralesf1f1ba52017-11-20 16:38:28 -08006vnfsdk_repos=("vnfsdk/compliance" "vnfsdk/functest" "vnfsdk/lctest" \
7"vnfsdk/model" "vnfsdk/pkgtools" "vnfsdk/refrepo" "vnfsdk/validation")
Shashank Kumar Shankard52d0af2017-10-20 16:06:08 -07008
9# _build_vnfsdk_images() - Builds VNFSDK images from source code
10function _build_vnfsdk_images {
11 install_package unzip
12 pushd $vnfsdk_src_folder/refrepo/vnfmarket-be/deployment/docker/docker-refrepo
13 build_docker_image .
14 popd
15}
16
17# get_vnfsdk_images - Function that clones vnfsdk Docker images
18function get_vnfsdk_images {
19 if [[ "$build_image" == "True" ]]; then
20 # TODO(sshank): Has errors building.
21 _build_vnfsdk_images
22 else
23 pull_docker_image refrepo:1.0-STAGING-latest
24 pull_docker_image refrepo:latest
25 fi
26}
27
28# install_vnfsdk - Function that installs vnfsdk Docker images
29function install_vnfsdk {
30 install_docker_compose
31 pushd $vnfsdk_src_folder/refrepo/vnfmarket-be/deployment/install
32 /opt/docker/docker-compose up -d
33 popd
34}
35
36# init_vnfsdk() - Init VNFSDK services
37function init_vnfsdk {
38 if [[ "$clone_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080039 clone_repos "vnfsdk"
Shashank Kumar Shankard52d0af2017-10-20 16:06:08 -070040 if [[ "$compile_repo" == "True" ]]; then
Victor Moralesf1f1ba52017-11-20 16:38:28 -080041 compile_repos "vnfsdk"
Shashank Kumar Shankard52d0af2017-10-20 16:06:08 -070042 fi
43 fi
44
45 if [[ "$skip_get_images" == "False" ]]; then
46 get_vnfsdk_images
47 if [[ "$skip_install" == "False" ]]; then
48 install_vnfsdk
49 fi
50 fi
51}