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