diff --git a/README.rst b/README.rst index 6a55198..5035cef 100644 --- a/README.rst +++ b/README.rst @@ -1,14 +1,22 @@ OpenStack Dashboard plugin for Sahara project ============================================= -How to use: ------------ +How to use with Horizon on server: +---------------------------------- Use pip to install the package on the server running Horizon. Then either copy or link the files in sahara_dashboard/enabled to openstack_dashboard/local/enabled. This step will cause the Horizon service to pick up the Sahara plugin when it starts. +How to use with devstack: +------------------------- + +Add the following to your devstack ``local.conf`` file:: + + enable_plugin sahara-dashboard git://git.openstack.org/openstack/sahara-dashboard + + To run unit tests: ------------------ diff --git a/devstack/plugin.sh b/devstack/plugin.sh new file mode 100644 index 0000000..2781248 --- /dev/null +++ b/devstack/plugin.sh @@ -0,0 +1,49 @@ +# plugin.sh - DevStack plugin.sh dispatch script sahara-dashboard + +SAHARA_DASH_DIR=$(cd $(dirname $BASH_SOURCE)/.. && pwd) + +function install_sahara_dashboard { + sudo pip install --upgrade ${SAHARA_DASH_DIR} + + cp -a ${SAHARA_DASH_DIR}/sahara_dashboard/enabled/* ${DEST}/horizon/openstack_dashboard/enabled/ + python ${DEST}/horizon/manage.py collectstatic --noinput + python ${DEST}/horizon/manage.py compress --force +} + +# check for service enabled +if is_service_enabled sahara-dashboard; 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 + # no-op + : + + elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then + # Configure after the other layer 1 and 2 services have been configured + echo_summary "Installing Sahara Dashboard" + install_sahara_dashboard + + elif [[ "$1" == "stack" && "$2" == "extra" ]]; then + # Initialize and start the app-catalog-ui service + # no-op + : + fi + + if [[ "$1" == "unstack" ]]; then + # Shut down app-catalog-ui services + # 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..374d365 --- /dev/null +++ b/devstack/settings @@ -0,0 +1,2 @@ +# settings file for sahara-dashboard plugin +enable_service sahara-dashboard