Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Victor Morales | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 3 | source /var/onap/functions |
| 4 | |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 5 | testsuite_src_folder=$git_src_folder/testsuite |
| 6 | testsuite_repos=("testsuite" "testsuite/heatbridge" "testsuite/properties" \ |
| 7 | "testsuite/python-testing-utils") |
Victor Morales | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 8 | |
| 9 | # _setup_ete_folder() - Create and copy ete folder structure |
| 10 | function _setup_ete_folder { |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 11 | mkdir -p /opt/eteshare/config |
| 12 | |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 13 | cp $testsuite_src_folder/integration_* /opt/eteshare/config |
| 14 | cp $testsuite_src_folder/vm_config2robot.sh /opt/eteshare/config |
| 15 | cp $testsuite_src_folder/ete.sh /opt |
| 16 | cp $testsuite_src_folder/demo.sh /opt |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 17 | |
| 18 | chmod +x /opt/ete.sh |
| 19 | chmod +x /opt/demo.sh |
| 20 | } |
| 21 | |
Victor Morales | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 22 | # get_robot_images() - Pull or build the Robot Docker images |
| 23 | function get_robot_images { |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 24 | pull_openecomp_image testsuite |
Victor Morales | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | # install_robot() - Run Robot services |
| 28 | function install_robot { |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 29 | docker rm -f openecompete_container |
| 30 | docker run -d --name openecompete_container -v /opt/eteshare:/share -p 88:88 $nexus_docker_repo/openecomp/testsuite:$docker_version |
| 31 | } |
| 32 | |
| 33 | # init_robot() - Function that initialize Robot services |
| 34 | function init_robot { |
Victor Morales | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 35 | if [[ "$clone_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 36 | clone_repos "testsuite" |
Victor Morales | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 37 | _setup_ete_folder |
| 38 | if [[ "$compile_repo" == "True" ]]; then |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 39 | compile_repos "testsuite" |
Victor Morales | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 40 | fi |
| 41 | fi |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 42 | |
| 43 | if [[ "$skip_get_images" == "False" ]]; then |
| 44 | get_robot_images |
| 45 | if [[ "$skip_install" == "False" ]]; then |
| 46 | install_robot |
| 47 | fi |
| 48 | fi |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 49 | } |