Victor Morales | 896c807 | 2017-09-12 12:19:57 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Victor Morales | 896c807 | 2017-09-12 12:19:57 -0700 | [diff] [blame] | 3 | source /var/onap/functions |
| 4 | |
| 5 | ccsdk_src_folder=$git_src_folder/ccsdk |
Victor Morales | 21404d7 | 2017-10-20 13:18:26 -0700 | [diff] [blame] | 6 | ccsdk_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 Morales | 896c807 | 2017-09-12 12:19:57 -0700 | [diff] [blame] | 11 | |
| 12 | # clone_ccsdk_repos() - Function that clones the CCSDK repositories |
| 13 | function clone_ccsdk_repos { |
Victor Morales | 21404d7 | 2017-10-20 13:18:26 -0700 | [diff] [blame] | 14 | for repo in ${ccsdk_repos[@]}; do |
| 15 | clone_repo $repo $ccsdk_src_folder${repo#ccsdk} |
Victor Morales | 896c807 | 2017-09-12 12:19:57 -0700 | [diff] [blame] | 16 | done |
| 17 | } |
| 18 | |
| 19 | # compile_ccsdk_repos() - |
| 20 | function compile_ccsdk_repos { |
Victor Morales | 21404d7 | 2017-10-20 13:18:26 -0700 | [diff] [blame] | 21 | install_package unzip |
| 22 | for repo in ${ccsdk_repos[@]}; do |
| 23 | compile_src $ccsdk_src_folder${repo#ccsdk} |
Victor Morales | 896c807 | 2017-09-12 12:19:57 -0700 | [diff] [blame] | 24 | done |
| 25 | } |
| 26 | |
| 27 | # _build_ccsdk_images() - Build CCSDK Docker images from source code |
| 28 | function _build_ccsdk_images { |
| 29 | install_package unzip |
Victor Morales | 896c807 | 2017-09-12 12:19:57 -0700 | [diff] [blame] | 30 | clone_repo ccsdk/distribution $ccsdk_src_folder/distribution |
Victor Morales | c9b8154 | 2017-09-14 15:46:21 -0700 | [diff] [blame] | 31 | compile_src $ccsdk_src_folder/distribution |
Victor Morales | 896c807 | 2017-09-12 12:19:57 -0700 | [diff] [blame] | 32 | 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 |
| 38 | function 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 Morales | 896c807 | 2017-09-12 12:19:57 -0700 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | # init_ccsdk() - Function that initialize Multi Cloud services |
| 49 | function 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 Morales | 896c807 | 2017-09-12 12:19:57 -0700 | [diff] [blame] | 56 | } |