4.1.15. use

Description

Loads an environment.

Usage

use ENV

  • ENV is the environment to load. This can be an evnironment name (if unique) or a full path.

Ant Usage

Not an ant task

Examples

# Load the development environment and launch tomcat
use dev
tomcat start
# Load the tools environment inside the home directory
use ~/tools

Notes

  • This command is not executed with 'bw'.
  • The 'use' command executes the 'load' Bundle hook for all bundles deployed in an environment. On UNIX-based and Linux systems, the load.sh script is sourced, so that it can affect the current environment.
  • In addition to executing (i.e. sourcing) the 'load' hook within a bundle, the 'use' command will also look for and execute a 'load' script within the deployed bundle's 'work' directory, specifically inside 'work/actions'. This allows environment variables to be changed on a per deployment basis.
  • The 'use' command also creates aliases for any executable bundle deployed in the environment. This allows commands to be executed more easily. For example, if the environment /local/dev contains a deployed apache bundle, the command 'use /local/dev' would create an alias 'apache=bw "/local/dev"'. With this alias, 'apache start' would send the start command to start apache.
  • The 'use' command will also execute the 'unload' Bundle hook if a bundle with the same name has been previously loaded.