Add stack phases to extras.d handling
Add hooks to stack.sh, unstack.sh and clean.sh to call the extras.d
scripts at multiple points in stack.sh. This allows these scripts to
perform installation and startup tasks at similar times as they would
if integrated into stack.sh.
extras.d/70-tempest.sh is present as an example of the structure
of these scripts.
See extras.d/README.md for more information.
Change-Id: Ic1fe522559b94d204d6c0319a2e3d23684c8d028
diff --git a/stack.sh b/stack.sh
index 14ec023..aa0efea 100755
--- a/stack.sh
+++ b/stack.sh
@@ -313,6 +313,16 @@
source $TOP_DIR/lib/ironic
source $TOP_DIR/lib/trove
+# Extras Source
+# --------------
+
+# Phase: source
+if [[ -d $TOP_DIR/extras.d ]]; then
+ for i in $TOP_DIR/extras.d/*.sh; do
+ [[ -r $i ]] && source $i source
+ done
+fi
+
# Set the destination directories for other OpenStack projects
OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
@@ -725,6 +735,16 @@
configure_ironic
fi
+# Extras Install
+# --------------
+
+# Phase: install
+if [[ -d $TOP_DIR/extras.d ]]; then
+ for i in $TOP_DIR/extras.d/*.sh; do
+ [[ -r $i ]] && source $i stack install
+ done
+fi
+
if [[ $TRACK_DEPENDS = True ]]; then
$DEST/.venv/bin/pip freeze > $DEST/requires-post-pip
if ! diff -Nru $DEST/requires-pre-pip $DEST/requires-post-pip > $DEST/requires.diff; then
@@ -1000,6 +1020,17 @@
fi
+# Extras Configuration
+# ====================
+
+# Phase: post-config
+if [[ -d $TOP_DIR/extras.d ]]; then
+ for i in $TOP_DIR/extras.d/*.sh; do
+ [[ -r $i ]] && source $i stack post-config
+ done
+fi
+
+
# Local Configuration
# ===================
@@ -1214,9 +1245,10 @@
# Run extras
# ==========
+# Phase: extra
if [[ -d $TOP_DIR/extras.d ]]; then
for i in $TOP_DIR/extras.d/*.sh; do
- [[ -r $i ]] && source $i stack
+ [[ -r $i ]] && source $i stack extra
done
fi