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