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 | |
Shashank Kumar Shankar | d52d0af | 2017-10-20 16:06:08 -0700 | [diff] [blame] | 5 | # _build_vnfsdk_images() - Builds VNFSDK images from source code |
| 6 | function _build_vnfsdk_images { |
| 7 | install_package unzip |
Victor Morales | f8730f5 | 2018-03-02 13:24:33 -0800 | [diff] [blame] | 8 | pushd ${src_folders[vnfsdk]}/refrepo/vnfmarket-be/deployment/docker/docker-refrepo |
Shashank Kumar Shankar | d52d0af | 2017-10-20 16:06:08 -0700 | [diff] [blame] | 9 | build_docker_image . |
| 10 | popd |
| 11 | } |
| 12 | |
| 13 | # get_vnfsdk_images - Function that clones vnfsdk Docker images |
| 14 | function get_vnfsdk_images { |
| 15 | if [[ "$build_image" == "True" ]]; then |
| 16 | # TODO(sshank): Has errors building. |
| 17 | _build_vnfsdk_images |
| 18 | else |
| 19 | pull_docker_image refrepo:1.0-STAGING-latest |
| 20 | pull_docker_image refrepo:latest |
| 21 | fi |
| 22 | } |
| 23 | |
| 24 | # install_vnfsdk - Function that installs vnfsdk Docker images |
| 25 | function install_vnfsdk { |
| 26 | install_docker_compose |
Victor Morales | f8730f5 | 2018-03-02 13:24:33 -0800 | [diff] [blame] | 27 | pushd ${src_folders[vnfsdk]}/refrepo/vnfmarket-be/deployment/install |
Shashank Kumar Shankar | d52d0af | 2017-10-20 16:06:08 -0700 | [diff] [blame] | 28 | /opt/docker/docker-compose up -d |
| 29 | popd |
| 30 | } |
| 31 | |
| 32 | # init_vnfsdk() - Init VNFSDK services |
| 33 | function init_vnfsdk { |
| 34 | if [[ "$clone_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 35 | clone_repos "vnfsdk" |
Shashank Kumar Shankar | d52d0af | 2017-10-20 16:06:08 -0700 | [diff] [blame] | 36 | if [[ "$compile_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 37 | compile_repos "vnfsdk" |
Shashank Kumar Shankar | d52d0af | 2017-10-20 16:06:08 -0700 | [diff] [blame] | 38 | fi |
| 39 | fi |
| 40 | |
| 41 | if [[ "$skip_get_images" == "False" ]]; then |
| 42 | get_vnfsdk_images |
| 43 | if [[ "$skip_install" == "False" ]]; then |
| 44 | install_vnfsdk |
| 45 | fi |
| 46 | fi |
| 47 | } |