blob: 3502e01e8f19ce92b3513857a35d6789e5bc6a94 [file] [log] [blame]
Victor Morales896c8072017-09-12 12:19:57 -07001#!/bin/bash
2
Victor Morales896c8072017-09-12 12:19:57 -07003source /var/onap/functions
4
5ccsdk_src_folder=$git_src_folder/ccsdk
Victor Morales21404d72017-10-20 13:18:26 -07006ccsdk_repos=("ccsdk" "ccsdk/dashboard" "ccsdk/distribution" "ccsdk/parent"
7"ccsdk/platform/blueprints" "ccsdk/platform/nbapi" "ccsdk/platform/plugins"
8"ccsdk/sli" "ccsdk/sli/adaptors" "ccsdk/sli/core" "ccsdk/sli/northbound"
9"ccsdk/sli/plugins" "ccsdk/storage" "ccsdk/storage/esaas" "ccsdk/storage/pgaas"
10"ccsdk/utils")
Victor Morales896c8072017-09-12 12:19:57 -070011
12# clone_ccsdk_repos() - Function that clones the CCSDK repositories
13function clone_ccsdk_repos {
Victor Morales21404d72017-10-20 13:18:26 -070014 for repo in ${ccsdk_repos[@]}; do
15 clone_repo $repo $ccsdk_src_folder${repo#ccsdk}
Victor Morales896c8072017-09-12 12:19:57 -070016 done
17}
18
19# compile_ccsdk_repos() -
20function compile_ccsdk_repos {
Victor Morales21404d72017-10-20 13:18:26 -070021 install_package unzip
22 for repo in ${ccsdk_repos[@]}; do
23 compile_src $ccsdk_src_folder${repo#ccsdk}
Victor Morales896c8072017-09-12 12:19:57 -070024 done
25}
26
27# _build_ccsdk_images() - Build CCSDK Docker images from source code
28function _build_ccsdk_images {
29 install_package unzip
Victor Morales896c8072017-09-12 12:19:57 -070030 clone_repo ccsdk/distribution $ccsdk_src_folder/distribution
Victor Moralesc9b81542017-09-14 15:46:21 -070031 compile_src $ccsdk_src_folder/distribution
Victor Morales896c8072017-09-12 12:19:57 -070032 for image in ubuntu opendaylight odlsli dgbuilder-docker; do
33 build_docker_image $ccsdk_src_folder/distribution/$image docker
34 done
35}
36
37# get_ccsdk_images() - Get CCSDK Docker images
38function get_ccsdk_images {
39 if [[ "$build_image" == "True" ]]; then
40 _build_ccsdk_images
41 else
42 for image in ubuntu odl dgbuilder; do
43 pull_onap_image ccsdk-$image-image
44 done
45 fi
Victor Morales896c8072017-09-12 12:19:57 -070046}
47
48# init_ccsdk() - Function that initialize Multi Cloud services
49function init_ccsdk {
50 if [[ "$clone_repo" == "True" ]]; then
51 clone_ccsdk_repos
52 if [[ "$compile_repo" == "True" ]]; then
53 compile_ccsdk_repos
54 fi
55 fi
Victor Morales896c8072017-09-12 12:19:57 -070056}