Shashank Kumar Shankar | d52d0af | 2017-10-20 16:06:08 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Shashank Kumar Shankar | d52d0af | 2017-10-20 16:06:08 -0700 | [diff] [blame] | 3 | source /var/onap/functions |
| 4 | |
| 5 | vnfsdk_src_folder=$git_src_folder/vnfsdk |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame^] | 6 | vnfsdk_repos=("vnfsdk/compliance" "vnfsdk/functest" "vnfsdk/lctest" \ |
| 7 | "vnfsdk/model" "vnfsdk/pkgtools" "vnfsdk/refrepo" "vnfsdk/validation") |
Shashank Kumar Shankar | d52d0af | 2017-10-20 16:06:08 -0700 | [diff] [blame] | 8 | |
| 9 | # _build_vnfsdk_images() - Builds VNFSDK images from source code |
| 10 | function _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 |
| 18 | function 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 |
| 29 | function 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 |
| 37 | function init_vnfsdk { |
| 38 | if [[ "$clone_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame^] | 39 | clone_repos "vnfsdk" |
Shashank Kumar Shankar | d52d0af | 2017-10-20 16:06:08 -0700 | [diff] [blame] | 40 | if [[ "$compile_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame^] | 41 | compile_repos "vnfsdk" |
Shashank Kumar Shankar | d52d0af | 2017-10-20 16:06:08 -0700 | [diff] [blame] | 42 | 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 | } |