blob: 6dcdf90f066c0167769b1b718078c8004a14c6eb [file] [log] [blame]
Victor Morales89ce3212017-06-16 18:32:48 -05001#!/bin/bash
2
Victor Morales0f94b4a2017-09-01 18:42:40 -05003source /var/onap/functions
4
5robot_src_folder=$git_src_folder/testsuite
6robot_repos=("heatbridge" "properties" "python-testing-utils")
7
8# clone_robot_repos() - Function that clones Robot source repo.
9function clone_robot_repos {
10 clone_repo testsuite $robot_src_folder
11
12 for dirc in ${robot_repos[@]}; do
13 clone_repo testsuite/$dirc $robot_src_folder/$dirc
14 done
15}
16
17# compile_robot_repos() - Function that compile Robot source repo.
18function compile_robot_repos {
19 install_python_package tox
20 compile_src $robot_src_folder
21
22 for dirc in ${robot_repos[@]}; do
23 compile_src $robot_src_folder/$dirc
24 done
25}
26
27# _setup_ete_folder() - Create and copy ete folder structure
28function _setup_ete_folder {
Victor Morales89ce3212017-06-16 18:32:48 -050029 mkdir -p /opt/eteshare/config
30
Victor Morales89ce3212017-06-16 18:32:48 -050031 cp $src_folder/integration_* /opt/eteshare/config
32 cp $src_folder/vm_config2robot.sh /opt/eteshare/config
33 cp $src_folder/ete.sh /opt
34 cp $src_folderdemo.sh /opt
35
36 chmod +x /opt/ete.sh
37 chmod +x /opt/demo.sh
38}
39
Victor Morales0f94b4a2017-09-01 18:42:40 -050040# get_robot_images() - Pull or build the Robot Docker images
41function get_robot_images {
Victor Morales89ce3212017-06-16 18:32:48 -050042 pull_openecomp_image testsuite
Victor Morales0f94b4a2017-09-01 18:42:40 -050043}
44
45# install_robot() - Run Robot services
46function install_robot {
Victor Morales89ce3212017-06-16 18:32:48 -050047 docker rm -f openecompete_container
48 docker run -d --name openecompete_container -v /opt/eteshare:/share -p 88:88 $nexus_docker_repo/openecomp/testsuite:$docker_version
49}
50
51# init_robot() - Function that initialize Robot services
52function init_robot {
Victor Morales0f94b4a2017-09-01 18:42:40 -050053 if [[ "$clone_repo" == "True" ]]; then
54 clone_robot_repos
55 _setup_ete_folder
56 if [[ "$compile_repo" == "True" ]]; then
57 compile_robot_repos
58 fi
59 fi
Victor Morales6a919972017-09-28 18:29:54 -070060
61 if [[ "$skip_get_images" == "False" ]]; then
62 get_robot_images
63 if [[ "$skip_install" == "False" ]]; then
64 install_robot
65 fi
66 fi
Victor Morales89ce3212017-06-16 18:32:48 -050067}