- #!/bin/bash
- export DEVSTACK_IP=172.18.10.87
- export DEVSTACK_DEMO_PASS=demo
- git clone http://github.com/openstack/horizon
- git clone http://github.com/openstack/sahara-dashboard
- cd horizon
- export horizon_dir=`pwd`
- git fetch https://review.openstack.org/openstack/horizon refs/changes/08/253608/6 && git checkout FETCH_HEAD
- #git review -d 253608,6
- cd ../sahara-dashboard
- export sahara_dir=`pwd`
- git fetch https://review.openstack.org/openstack/sahara-dashboard refs/changes/53/253653/4 && git checkout FETCH_HEAD
- #git review -d 253653,4
- cp sahara_dashboard/enabled/_18*.py ../horizon/openstack_dashboard/local/enabled/
- python tools/install_venv.py
- rm -rf .venv/src/horizon/
- ln -s $horizon_dir .venv/src/horizon
- cd ../horizon
- python tools/install_venv.py
- cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
- sed -i "/OPENSTACK_HOST = \"127.0.0.1\"/c\OPENSTACK_HOST = '$DEVSTACK_IP'" openstack_dashboard/local/local_settings.py
- echo 'COMPRESS_OFFLINE = True' >> openstack_dashboard/local/local_settings.py
- sed -i "/import sys/a\sys.path.append('$sahara_dir')" manage.py
- tools/with_venv.sh ./manage.py collectstatic --noinput --clear && tools/with_venv.sh ./manage.py compress
- screen -S django-horizon -d -m tools/with_venv.sh ./manage.py runserver
- cd ../sahara-dashboard
- export conf_file=sahara_dashboard/test/integration_tests/horizon.conf
- sed -i '/dashboard_url=http:\/\/localhost\/dashboard\//c\dashboard_url=http://localhost:8000' $conf_file
- sed -i '/login_url=http:\/\/localhost\/dashboard\/auth\/login\//c\login_url=http://localhost:8000/auth/login/' $conf_file
- sed -i "/password=pass/c\password=$DEVSTACK_DEMO_PASS" $conf_file
- tools/with_venv.sh ./run_tests.sh -N --integration