Browse Source

Add devstack directory

Add a devstack directory to the castellan-ui
plugin so that it can be installed in devstack
using the enable_plugin line.

Change-Id: Ic08f2fb188c84ef9d44ab394e5677b780f0e3b14
tags/0.1.0
Brianna Poulos 1 year ago
parent
commit
9f8ec14dfe
4 changed files with 85 additions and 2 deletions
  1. 2
    2
      README.rst
  2. 19
    0
      devstack/README.rst
  3. 61
    0
      devstack/plugin.sh
  4. 3
    0
      devstack/settings

+ 2
- 2
README.rst View File

@@ -19,7 +19,7 @@ Enabling in DevStack
19 19
 Add this repo as an external repository into your ``local.conf`` file::
20 20
 
21 21
     [[local|localrc]]
22
-    enable_plugin castellan_ui https://github.com/openstack/castellan-ui
22
+    enable_plugin castellan-ui https://github.com/openstack/castellan-ui
23 23
 
24 24
 Manual Installation
25 25
 -------------------
@@ -61,4 +61,4 @@ To run horizon with the newly enabled Castellan UI plugin run::
61 61
     ./run_tests.sh --runserver 0.0.0.0:8080
62 62
 
63 63
 to have the application start on port 8080 and the horizon dashboard will be
64
-available in your browser at http://localhost:8080/
64
+available in your browser at http://localhost:8080/

+ 19
- 0
devstack/README.rst View File

@@ -0,0 +1,19 @@
1
+================================
2
+DevStack plugin for castellan-ui
3
+================================
4
+
5
+This is setup as a DevStack plugin.
6
+For more information on DevStack plugins,
7
+see the `DevStack Plugins documentation
8
+<https://docs.openstack.org/devstack/latest/plugins.html>`__.
9
+
10
+How to enable castellan-ui dashboard
11
+------------------------------------
12
+
13
+Add this repo as an external repository into your ``local.conf`` file::
14
+
15
+.. code-block:: none
16
+
17
+    [[local|localrc]]
18
+    enable_plugin castellan-ui https://github.com/openstack/castellan-ui
19
+

+ 61
- 0
devstack/plugin.sh View File

@@ -0,0 +1,61 @@
1
+# plugin.sh - DevStack plugin.sh dispatch script castellan-ui
2
+
3
+CASTELLAN_UI_DIR=$(cd $(dirname $BASH_SOURCE)/.. && pwd)
4
+CASTELLAN_UI_ENABLED_DIR=$CASTELLAN_UI_DIR/castellan_ui/enabled
5
+HORIZON_ENABLED_DIR=$DEST/horizon/openstack_dashboard/local/enabled
6
+
7
+function install_castellan_ui {
8
+    setup_develop $CASTELLAN_UI_DIR
9
+}
10
+
11
+function configure_castellan_ui {
12
+    cp -a $CASTELLAN_UI_ENABLED_DIR/_[0-9]*.py $HORIZON_ENABLED_DIR
13
+    # NOTE: If locale directory does not exist, compilemessages will fail,
14
+    # so check for an existence of locale directory is required.
15
+    if [ -d $CASTELLAN_UI_DIR/castellan_ui/locale ]; then
16
+        (cd $CASTELLAN_UI_DIR/castellan_ui; \
17
+         DJANGO_SETTINGS_MODULE=openstack_dashboard.settings ../manage.py compilemessages)
18
+    fi
19
+}
20
+
21
+# check for service enabled
22
+if is_service_enabled castellan-ui; then
23
+
24
+    if [[ "$1" == "stack" && "$2" == "pre-install"  ]]; then
25
+        # Set up system services
26
+        echo_summary "Configuring Castellan UI"
27
+        # no-op
28
+        :
29
+
30
+    elif [[ "$1" == "stack" && "$2" == "install"  ]]; then
31
+        # Perform installation of service source
32
+        echo_summary "Installing Castellan UI"
33
+        install_castellan_ui
34
+
35
+    elif [[ "$1" == "stack" && "$2" == "post-config"  ]]; then
36
+        # Configure after the other layer 1 and 2 services have been configured
37
+        echo_summary "Configurng Castellan UI"
38
+        configure_castellan_ui
39
+
40
+    elif [[ "$1" == "stack" && "$2" == "extra"  ]]; then
41
+        # no-op
42
+        :
43
+    fi
44
+
45
+    if [[ "$1" == "unstack"  ]]; then
46
+        # Remove enabled file(s)
47
+        for _enabled_file in $CASTELLAN_UI_ENABLED_DIR/_[0-9]*.py; do
48
+            _enabled_basename=$(basename $_enabled_file .py)
49
+            rm -f $HORIZON_ENABLED_DIR/${_enabled_basename}.py*
50
+            rm -f $HORIZON_ENABLED_DIR/__pycache__/${_enabled_basename}.*pyc
51
+        done
52
+    fi
53
+
54
+    if [[ "$1" == "clean"  ]]; then
55
+        # Remove state and transient data
56
+        # Remember clean.sh first calls unstack.sh
57
+        # no-op
58
+        :
59
+    fi
60
+fi
61
+

+ 3
- 0
devstack/settings View File

@@ -0,0 +1,3 @@
1
+# settings file for castellan-ui plugin
2
+define_plugin castellan-ui
3
+enable_service castellan-ui

Loading…
Cancel
Save