diff --git a/README.rst b/README.rst index 4f5e94e..19bb3ae 100644 --- a/README.rst +++ b/README.rst @@ -8,8 +8,16 @@ Zaqar Dashboard * Source: http://git.openstack.org/cgit/openstack/zaqar-ui * Bugs: http://bugs.launchpad.net/zaqar-ui -Installation instructions -------------------------- +Enabling in DevStack +-------------------- + +Add this repo as an external repository into your ``local.conf`` file:: + + [[local|localrc]] + enable_plugin zaqar-ui https://github.com/openstack/zaqar-ui + +Manual Installation +------------------- Begin by cloning the Horizon and Zaqar UI repositories:: diff --git a/devstack/plugin.sh b/devstack/plugin.sh new file mode 100644 index 0000000..5128852 --- /dev/null +++ b/devstack/plugin.sh @@ -0,0 +1,60 @@ +# plugin.sh - DevStack plugin.sh dispatch script zaqar-ui + +ZAQAR_UI_DIR=$(cd $(dirname $BASH_SOURCE)/.. && pwd) + +function install_zaqar_ui { + # NOTE(shu-mutou): workaround for devstack bug: 1540328 + # where devstack install 'test-requirements' but should not do it + # for zaqar-ui project as it installs Horizon from url. + # Remove following two 'mv' commands when mentioned bug is fixed. + mv $ZAQAR_UI_DIR/test-requirements.txt $ZAQAR_UI_DIR/_test-requirements.txt + + setup_develop ${ZAQAR_UI_DIR} + + mv $ZAQAR_UI_DIR/_test-requirements.txt $ZAQAR_UI_DIR/test-requirements.txt +} + +function configure_zaqar_ui { + cp -a ${ZAQAR_UI_DIR}/zaqar_ui/enabled/* ${DEST}/horizon/openstack_dashboard/local/enabled/ + # NOTE: If locale directory does not exist, compilemessages will fail, + # so check for an existence of locale directory is required. + if [ -d ${ZAQAR_UI_DIR}/zaqar_ui/locale ]; then + (cd ${ZAQAR_UI_DIR}/zaqar_ui; DJANGO_SETTINGS_MODULE=openstack_dashboard.settings ../manage.py compilemessages) + fi +} + +# check for service enabled +if is_service_enabled zaqar-ui; then + + if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then + # Set up system services + # no-op + : + + elif [[ "$1" == "stack" && "$2" == "install" ]]; then + # Perform installation of service source + echo_summary "Installing Zaqar UI" + install_zaqar_ui + + elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then + # Configure after the other layer 1 and 2 services have been configured + echo_summary "Configuring Zaqar UI" + configure_zaqar_ui + + elif [[ "$1" == "stack" && "$2" == "extra" ]]; then + # no-op + : + fi + + if [[ "$1" == "unstack" ]]; then + # no-op + : + fi + + if [[ "$1" == "clean" ]]; then + # Remove state and transient data + # Remember clean.sh first calls unstack.sh + # no-op + : + fi +fi diff --git a/devstack/settings b/devstack/settings new file mode 100644 index 0000000..94e8055 --- /dev/null +++ b/devstack/settings @@ -0,0 +1,3 @@ +# settings file for zaqar-ui plugin +enable_service zaqar-ui + diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..5f74dc0 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,25 @@ +[metadata] +name = zaqar-ui +version = 0.0.1 +summary = Zaqar User Interface +description-file = + README.rst +author = OpenStack +author-email = openstack-dev@lists.openstack.org +home-page = http://www.openstack.org/ +classifier = + Environment :: OpenStack + Framework :: Django + Intended Audience :: Information Technology + Intended Audience :: System Administrators + License :: OSI Approved :: Apache Software License + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: 2 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.4 + +[files] +packages = + zaqar_ui diff --git a/setup.py b/setup.py index 3d436ba..4a1874a 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#!/usr/bin/env python # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,32 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from setuptools import find_packages -from setuptools import setup +import setuptools -setup( - name='zaqar-ui', - version='0.0.1', - summary='Zaqar User Interface', - description_file='README.rst', - author='OpenStack', - author_email='openstack-dev@lists.openstack.org', - home_page='http://www.openstack.org/', - classifiers=[ - 'Environment :: OpenStack', - 'Framework :: Django', - 'Intended Audience :: Information Technology', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - ], - packages=find_packages(), - include_package_data=True, -) +try: + import multiprocessing # noqa +except ImportError: + pass + +setuptools.setup( + setup_requires=['pbr>=1.8'], + pbr=True)