132fbae125a6a8d808154ff612e959f2d97b328e
[demo.git] / boot / robot_vm_init.sh
1 #!/bin/bash
2
3 NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt)
4 NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt)
5 NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt)
6 NEXUS_REPO=$(cat /opt/config/nexus_repo.txt)
7 DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt)
8 CLOUD_ENV=$(cat /opt/config/cloud_env.txt)
9
10 #
11 # Deploy latest robot configuration
12 #
13 cd /opt/testsuite/properties
14 git pull
15 cp integration_* /opt/eteshare/config
16 cp vm_config2robot.sh /opt/eteshare/config
17 cp ete.sh /opt
18 cp demo.sh /opt
19
20 #
21 # Deploy latest heat templates
22 #
23 cd /opt/demo
24 git pull
25 cp -rf heat /opt/eteshare
26
27 #if [[ $CLOUD_ENV != "rackspace" ]]
28 #then
29 #       sed -i "s/10.0.1.1/"$(cat /opt/config/aai1_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py
30 #       sed -i "s/10.0.2.1/"$(cat /opt/config/appc_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py
31 #       sed -i "s/10.0.4.1/"$(cat /opt/config/dcae_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py
32 #       sed -i "s/10.0.5.1/"$(cat /opt/config/so_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py
33 #       sed -i "s/10.0.11.1/"$(cat /opt/config/mr_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py
34 #       sed -i "s/10.0.6.1/"$(cat /opt/config/policy_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py
35 #       sed -i "s/10.0.9.1/"$(cat /opt/config/portal_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py
36 #       sed -i "s/10.0.3.1/"$(cat /opt/config/sdc_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py
37 #       sed -i "s/10.0.7.1/"$(cat /opt/config/sdnc_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py
38 #       sed -i "s/10.0.8.1/"$(cat /opt/config/vid_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py
39 #   sed -i "s/10.0.12.1/"$(cat /opt/config/clamp_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py
40 #       sed -i "s/https:\/\/identity.api.rackspacecloud.com/"$(cat /opt/config/keystone.txt)"/g" /opt/eteshare/config/integration_robot_properties.py
41 #fi
42
43 chmod +x /opt/ete.sh
44 chmod +x /opt/demo.sh
45
46 /bin/bash /opt/eteshare/config/vm_config2robot.sh
47
48 docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
49 docker pull $NEXUS_DOCKER_REPO/onap/testsuite:$DOCKER_IMAGE_VERSION
50 docker rm -f openecompete_container
51
52 docker pull $NEXUS_DOCKER_REPO/onap/sniroemulator:latest
53 docker rm -f sniroemulator
54
55 docker run -d --name openecompete_container -v /opt/eteshare:/share -p 88:88 $NEXUS_DOCKER_REPO/onap/testsuite:$DOCKER_IMAGE_VERSION
56 docker run -d --name sniroemulator -p 8080:9999 $NEXUS_DOCKER_REPO/onap/sniroemulator:latest