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 | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 5 | # _setup_ete_folder() - Create and copy ete folder structure |
| 6 | function _setup_ete_folder { |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 7 | mkdir -p /opt/eteshare/config |
| 8 | |
Victor Morales | 5d21f64 | 2017-12-07 11:54:59 -0800 | [diff] [blame] | 9 | cp $robot_src_folder/integration_* /opt/eteshare/config |
| 10 | cp $robot_src_folder/vm_config2robot.sh /opt/eteshare/config |
| 11 | cp $robot_src_folder/ete.sh /opt |
| 12 | cp $robot_src_folder/demo.sh /opt |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 13 | |
| 14 | chmod +x /opt/ete.sh |
| 15 | chmod +x /opt/demo.sh |
| 16 | } |
| 17 | |
Victor Morales | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 18 | # get_robot_images() - Pull or build the Robot Docker images |
| 19 | function get_robot_images { |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 20 | pull_openecomp_image testsuite |
Victor Morales | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | # install_robot() - Run Robot services |
| 24 | function install_robot { |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 25 | docker rm -f openecompete_container |
Victor Morales | 9d205bc | 2017-12-01 17:52:07 -0800 | [diff] [blame] | 26 | run_docker_image -d --name openecompete_container -v /opt/eteshare:/share -p 88:88 $nexus_docker_repo/openecomp/testsuite:$docker_version |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | # init_robot() - Function that initialize Robot services |
| 30 | function init_robot { |
Victor Morales | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 31 | if [[ "$clone_repo" == "True" ]]; then |
Victor Morales | 5d21f64 | 2017-12-07 11:54:59 -0800 | [diff] [blame] | 32 | clone_repos "robot" "testsuite" |
Victor Morales | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 33 | _setup_ete_folder |
| 34 | if [[ "$compile_repo" == "True" ]]; then |
Victor Morales | 5d21f64 | 2017-12-07 11:54:59 -0800 | [diff] [blame] | 35 | compile_repos "robot" |
Victor Morales | 0f94b4a | 2017-09-01 18:42:40 -0500 | [diff] [blame] | 36 | fi |
| 37 | fi |
Victor Morales | 6a91997 | 2017-09-28 18:29:54 -0700 | [diff] [blame] | 38 | |
| 39 | if [[ "$skip_get_images" == "False" ]]; then |
| 40 | get_robot_images |
| 41 | if [[ "$skip_install" == "False" ]]; then |
| 42 | install_robot |
| 43 | fi |
| 44 | fi |
Victor Morales | 89ce321 | 2017-06-16 18:32:48 -0500 | [diff] [blame] | 45 | } |