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