Merge "setup onap demo by vagrant"
[demo.git] / vagrant / run_demo.sh
1 #!/usr/bin/env bash
2 set -ex
3
4 sudo apt-get install -y virtualbox
5 ver=$(apt-cache policy vagrant | grep Installed | cut -d ':' -f 3)
6 if [[ "$ver" != "1.8.7" ]]; then
7     wget --no-check-certificate https://releases.hashicorp.com/vagrant/1.8.7/vagrant_1.8.7_x86_64.deb
8     sudo dpkg -i vagrant_1.8.7_x86_64.deb
9 fi
10
11 vagrant destroy -f
12 vagrant up
13 vagrant ssh control -c "/vagrant/create_onap.sh"
14 sudo sed -i "/.*simpledemo.openecomp.org.*/d" /etc/hosts
15 cat hosts | sudo tee -a /etc/hosts
16 sleep 300
17 ssh -o StrictHostKeyChecking=no ubuntu@portal.api.simpledemo.openecomp.org -i onap "curl sina.com.cn"