Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -o xtrace |
| 4 | |
| 5 | source /var/onap/functions |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 6 | |
Victor Morales | 94b3e97 | 2017-08-17 14:55:55 -0500 | [diff] [blame] | 7 | src_folder=$git_src_folder/vfc |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 8 | vfc_repos=("gvnfm/vnflcm" "gvnfm/vnfmgr" "gvnfm/vnfres" "nfvo/catalog" "nfvo/driver/ems" "nfvo/driver/sfc" \ |
| 9 | "nfvo/driver/vnfm/gvnfm" "nfvo/driver/vnfm/svnfm" "nfvo/lcm" "nfvo/resmanagement" "nfvo/wfengine") |
| 10 | |
| 11 | # clone_all_vfc_repos() - Function that clones VF-C source repo. |
| 12 | function clone_all_vfc_repos { |
| 13 | for dirc in ${vfc_repos[@]}; do |
| 14 | clone_repo vfc/$dirc $src_folder/$dirc |
| 15 | done |
| 16 | } |
| 17 | |
| 18 | # compile_all_vfc_repos() - Function that compiles VF-C source repo. |
| 19 | function compile_all_vfc_repos { |
Victor Morales | 970ec19 | 2017-07-31 09:10:11 -0500 | [diff] [blame] | 20 | install_python_package tox |
| 21 | |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 22 | pushd $src_folder/gvnfm/vnflcm/lcm |
| 23 | tox -e py27 |
| 24 | popd |
| 25 | |
Shashank Kumar Shankar | 6cc4a43 | 2017-09-05 13:26:19 -0700 | [diff] [blame] | 26 | |
| 27 | pushd $src_folder/nfvo/lcm |
| 28 | tox -e py27 |
| 29 | popd |
| 30 | |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 31 | # TODO(sshank): Add compile for other vfc_repos. (Both Java and Python based.) |
| 32 | # Python based: |
| 33 | # gvnfm/vnflcm/lcm |
| 34 | # gvnfm/vnfmgr/mgr |
| 35 | # gvnfm/vnfres/res |
| 36 | # nfvo/driver/vnfm/gvnfm/gvnfmadapter |
| 37 | # nfvo/driver/vnfm/svnfm/zte/vmanager |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 38 | |
| 39 | # Java based: |
| 40 | # nfvo/catalog |
| 41 | # nfvo/driver/ems/ems/sems/boco/ems-driver |
| 42 | # nfvo/driver/sfc/zte/sfc-driver |
| 43 | # nfvo/driver/vnfm/gvnfm/juju/juju-vnfmadapter |
| 44 | # nfvo/driver/vnfm/svnfm/huawei/vnfmadapter |
| 45 | # nfvo/resmanagement |
| 46 | # nfvo/wfengine |
| 47 | } |
| 48 | |
Shashank Kumar Shankar | 6cc4a43 | 2017-09-05 13:26:19 -0700 | [diff] [blame] | 49 | # build_nfvo_lcm_image() - Build VFC NFVO LCM docker image |
| 50 | function build_nfvo_lcm_image { |
| 51 | pushd $src_folder/nfvo/lcm/docker |
| 52 | sed -i '$ d' build_image.sh |
| 53 | ./build_image.sh |
| 54 | popd |
| 55 | } |
| 56 | |
| 57 | # get_vfc_images() - Build VFC docker images |
| 58 | function get_vfc_images { |
| 59 | if [[ "$build_image" == "True" ]]; then |
| 60 | install_docker |
| 61 | build_nfvo_lcm_image |
| 62 | # TODO(sshank): Add other VFC component docker image builds when they are ready. |
| 63 | else |
| 64 | pull_docker_image nexus3.onap.org:10003/onap/vfc/nslcm latest |
| 65 | fi |
| 66 | } |
| 67 | |
| 68 | # run_vfc_images() - Run VFC docker images |
| 69 | function run_vfc_images() { |
| 70 | docker run -d --name vfc-nslcm -p 3306:3306 -p 8403:8403 -e MSB_ADDR=127.0.0.1 nexus3.onap.org:10003/onap/vfc/nslcm |
| 71 | # TODO(sshank): Run other VFC component docker images when they are ready. |
| 72 | } |
| 73 | |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 74 | # install_vfc() - Download and install vfc service from source code |
| 75 | function install_vfc { |
Shashank Kumar Shankar | 6cc4a43 | 2017-09-05 13:26:19 -0700 | [diff] [blame] | 76 | run_vfc_images |
Victor Morales | 94b3e97 | 2017-08-17 14:55:55 -0500 | [diff] [blame] | 77 | } |
| 78 | |
| 79 | # init_vfc() - Function that initialize VF-C services |
| 80 | function init_vfc { |
| 81 | install_package libmysqlclient-dev |
| 82 | |
Idan Amit | 1690e08 | 2017-08-20 08:58:14 +0300 | [diff] [blame] | 83 | if [[ "$clone_repo" == "True" ]]; then |
| 84 | clone_all_vfc_repos |
| 85 | if [[ "$compile_repo" == "False" ]]; then |
| 86 | compile_all_vfc_repos |
| 87 | fi |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 88 | fi |
| 89 | |
Shashank Kumar Shankar | 6cc4a43 | 2017-09-05 13:26:19 -0700 | [diff] [blame] | 90 | get_vfc_images |
Victor Morales | dd07480 | 2017-07-26 16:06:35 -0500 | [diff] [blame] | 91 | install_vfc |
| 92 | } |