blob: 03987ea7e89a9e6efb9bf508f667488d93bac779 [file] [log] [blame]
Victor Morales896c8072017-09-12 12:19:57 -07001#!/bin/bash
2
3set -o xtrace
4
5source /var/onap/functions
6
7ccsdk_src_folder=$git_src_folder/ccsdk
Victor Morales21404d72017-10-20 13:18:26 -07008ccsdk_repos=("ccsdk" "ccsdk/dashboard" "ccsdk/distribution" "ccsdk/parent"
9"ccsdk/platform/blueprints" "ccsdk/platform/nbapi" "ccsdk/platform/plugins"
10"ccsdk/sli" "ccsdk/sli/adaptors" "ccsdk/sli/core" "ccsdk/sli/northbound"
11"ccsdk/sli/plugins" "ccsdk/storage" "ccsdk/storage/esaas" "ccsdk/storage/pgaas"
12"ccsdk/utils")
Victor Morales896c8072017-09-12 12:19:57 -070013
14# clone_ccsdk_repos() - Function that clones the CCSDK repositories
15function clone_ccsdk_repos {
Victor Morales21404d72017-10-20 13:18:26 -070016 for repo in ${ccsdk_repos[@]}; do
17 clone_repo $repo $ccsdk_src_folder${repo#ccsdk}
Victor Morales896c8072017-09-12 12:19:57 -070018 done
19}
20
21# compile_ccsdk_repos() -
22function compile_ccsdk_repos {
Victor Morales21404d72017-10-20 13:18:26 -070023 install_package unzip
24 for repo in ${ccsdk_repos[@]}; do
25 compile_src $ccsdk_src_folder${repo#ccsdk}
Victor Morales896c8072017-09-12 12:19:57 -070026 done
27}
28
29# _build_ccsdk_images() - Build CCSDK Docker images from source code
30function _build_ccsdk_images {
31 install_package unzip
Victor Morales896c8072017-09-12 12:19:57 -070032 clone_repo ccsdk/distribution $ccsdk_src_folder/distribution
Victor Moralesc9b81542017-09-14 15:46:21 -070033 compile_src $ccsdk_src_folder/distribution
Victor Morales896c8072017-09-12 12:19:57 -070034 for image in ubuntu opendaylight odlsli dgbuilder-docker; do
35 build_docker_image $ccsdk_src_folder/distribution/$image docker
36 done
37}
38
39# get_ccsdk_images() - Get CCSDK Docker images
40function get_ccsdk_images {
41 if [[ "$build_image" == "True" ]]; then
42 _build_ccsdk_images
43 else
44 for image in ubuntu odl dgbuilder; do
45 pull_onap_image ccsdk-$image-image
46 done
47 fi
Victor Morales896c8072017-09-12 12:19:57 -070048}
49
50# init_ccsdk() - Function that initialize Multi Cloud services
51function init_ccsdk {
52 if [[ "$clone_repo" == "True" ]]; then
53 clone_ccsdk_repos
54 if [[ "$compile_repo" == "True" ]]; then
55 compile_ccsdk_repos
56 fi
57 fi
Victor Morales896c8072017-09-12 12:19:57 -070058}