Commit 20b2e419 authored by Michal Arbet's avatar Michal Arbet

Redesign of octavia-dashboard

parent 44648729
......@@ -31,6 +31,8 @@ Build-Depends-Indep:
python3-testscenarios (>= 0.4),
python3-testtools (>= 2.2.0),
python3-xvfbwrapper (>= 0.1.3),
python3-octavia,
python3-oslo.policy,
subunit,
Standards-Version: 4.1.5
Vcs-Git: https://salsa.debian.org/openstack-team/services/octavia-dashboard.git
......
/usr/*
/etc/openstack-dashboard/*
#!/bin/sh
set -e
if [ "${1}" = "configure" ] ; then
/usr/share/openstack-dashboard/manage.py collectstatic --clear --noinput
/usr/share/openstack-dashboard/manage.py compress --force
if [ -f /var/lib/openstack-dashboard/secret-key/.secret_key_store ]; then
rm /var/lib/openstack-dashboard/secret-key/.secret_key_store
fi
chown -R www-data /var/lib/openstack-dashboard/secret-key /var/lib/openstack-dashboard/static
fi
#DEBHELPER#
#!/bin/sh
set -e
if [ "$1" = "remove" ] || [ "$1" = "disappear" ] || [ "$1" = "purge" ] ; then
if [ -x /usr/share/openstack-dashboard/manage.py ] ; then
/usr/share/openstack-dashboard/manage.py collectstatic --clear --noinput
/usr/share/openstack-dashboard/manage.py compress --force
if [ -f /var/lib/openstack-dashboard/secret-key/.secret_key_store ]; then
rm /var/lib/openstack-dashboard/secret-key/.secret_key_store
fi
chown -R www-data /var/lib/openstack-dashboard/secret-key /var/lib/openstack-dashboard/static
fi
fi
#DEBHELPER#
......@@ -5,19 +5,9 @@ include /usr/share/openstack-pkg-tools/pkgos.make
%:
dh $@ --buildsystem=python_distutils --with python3
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
for i in $(PYTHON3S) ; do \
PYTHON=python$$i NOSE_WITH_OPENSTACK=1 \
NOSE_OPENSTACK_COLOR=1 \
NOSE_OPENSTACK_RED=0.05 \
NOSE_OPENSTACK_YELLOW=0.025 \
NOSE_OPENSTACK_SHOW_ELAPSED=1 \
DJANGO_SETTINGS_MODULE=octavia_dashboard.test.settings \
python3 -m coverage run \
$(CURDIR)/manage.py test octavia_dashboard --settings=octavia_dashboard.tests.settings ; \
done
endif
override_dh_clean:
dh_clean
rm -rf .coverage*
override_dh_auto_clean:
python3 setup.py clean
......@@ -25,32 +15,53 @@ override_dh_auto_clean:
override_dh_auto_build:
echo "Do nothing..."
override_dh_clean:
dh_clean -O--buildsystem=python_distutils
find . -name '*pyc' -delete
rm -f octavia_dashboard/tests/.secret_key_store
rm -rf .coverage*
rm -rf build
rm -f AUTHORS ChangeLog
override_dh_auto_install:
echo "Do nothing..."
override_dh_install:
for i in $(PYTHON3S) ; do \
python$$i setup.py install --install-layout=deb --root $(CURDIR)/debian/python3-octavia-dashboard ; \
python$$i setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp ; \
done
# Copy the dashboard static files on a webroot accessible path
mkdir -p $(CURDIR)/usr/share/openstack-dashboard/openstack_dashboard/dashboards/project
cp -auxf octavia_dashboard/static/dashboard/project/lbaasv2 $(CURDIR)/usr/share/openstack-dashboard/openstack_dashboard/dashboards/project
# Move config files to standard location
install -d -m 755 $(CURDIR)/debian/tmp/etc/openstack-dashboard/enabled
install -d -m 755 $(CURDIR)/debian/tmp/etc/openstack-dashboard/local_settings.d
install -d -m 755 $(CURDIR)/debian/tmp/etc/openstack-dashboard/policy
# Generate missing policy file
PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslopolicy-sample-generator \
--output-file=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/octavia_dashboard/conf/octavia_policy.json \
--format json \
--namespace octavia
# Move policy file
mv -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/octavia_dashboard/conf/octavia_policy.json $(CURDIR)/debian/tmp/etc/openstack-dashboard/policy/octavia_policy.json
# Move config enabled
mv -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/octavia_dashboard/enabled/_[0-9]*.py $(CURDIR)/debian/tmp/etc/openstack-dashboard/enabled/
mkdir -p $(CURDIR)/usr/share/openstack-dashboard/openstack_dashboard/static/app
cp -auxf octavia_dashboard/static/app/core $(CURDIR)/usr/share/openstack-dashboard/openstack_dashboard/static/app
# Move local_settings
mv -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/octavia_dashboard/local_settings.d/_[0-9]*.py $(CURDIR)/debian/tmp/etc/openstack-dashboard/local_settings.d/
# Activates the octavia_dashboard plugin in Horizon
# octavia_dashboard/enabled/_*
mkdir -p $(CURDIR)/debian/python3-octavia-dashboard/usr/lib/python3/dist-packages/openstack_dashboard/enabled
cp -r $(CURDIR)/octavia_dashboard/enabled/_* $(CURDIR)/debian/python3-octavia-dashboard/usr/lib/python3/dist-packages/openstack_dashboard/enabled
rm $(CURDIR)/debian/python3-octavia-dashboard/usr/lib/python3/dist-packages/openstack_dashboard/enabled/__init__.py
# Remove config dirs from /usr/lib/python3/dist-packages/octavia__dashboard/
rm -rf $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/octavia_dashboard/conf
rm -rf $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/octavia_dashboard/enabled
rm -rf $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/octavia_dashboard/local_settings.d/
mkdir -p $(CURDIR)/debian/python3-octavia-dashboard/usr/share/openstack-dashboard/openstack_dashboard/enabled
cp -r $(CURDIR)/octavia_dashboard/enabled/_*.py $(CURDIR)/debian/python3-octavia-dashboard/usr/share/openstack-dashboard/openstack_dashboard/enabled
rm $(CURDIR)/debian/python3-octavia-dashboard/usr/share/openstack-dashboard/openstack_dashboard/enabled/__init__.py
dh_install
dh_missing --fail-missing
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
for i in $(PYTHON3S) ; do \
PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages \
NOSE_WITH_OPENSTACK=1 \
NOSE_OPENSTACK_COLOR=1 \
NOSE_OPENSTACK_RED=0.05 \
NOSE_OPENSTACK_YELLOW=0.025 \
NOSE_OPENSTACK_SHOW_ELAPSED=1 \
python$$i $(CURDIR)/manage.py test octavia_dashboard -v 2 --settings=octavia_dashboard.tests.settings ; \
done
## Delete __pycache__
find . -name __pycache__ -prune -exec rm -rf {} +;
endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment