devstack/extras.d
Dean Troyer cdf3d76647 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
2013-10-15 16:13:47 -05:00
..
80-tempest.sh Add stack phases to extras.d handling 2013-10-15 16:13:47 -05:00
README.md Add stack phases to extras.d handling 2013-10-15 16:13:47 -05:00

Extras Hooks

The extras.d directory contains project dispatch scripts that are called at specific times by stack.sh, unstack.sh and clean.sh. These hooks are used to install, configure and start additional projects during a DevStack run without any modifications to the base DevStack scripts.

When stack.sh reaches one of the hook points it sources the scripts in extras.d that end with .sh. To control the order that the scripts are sourced their names start with a two digit sequence number. DevStack reserves the sequence numbers 00 through 09 and 90 through 99 for its own use.

The scripts are sourced at each hook point so they should not declare anything at the top level that would cause a problem, specifically, functions. This does allow the entire stack.sh variable space to be available. The scripts are sourced with one or more arguments, the first of which defines the hook phase:

arg 1: source | stack | unstack | clean

source: always called first in any of the scripts, used to set the
    initial defaults in a lib/* script or similar

stack: called by stack.sh.  There are three possible values for
    the second arg to distinguish the phase stack.sh is in:

    arg 2:  install | post-config | extra

unstack: called by unstack.sh

clean: called by clean.sh.  Remember, clean.sh also calls unstack.sh
    so that work need not be repeated.