Running AntDepo Commands | ![]() |
Command Line | ||
If you've installed AntDepo as described in the Installing AntDepo section, running the AntDepo command-line is simple: just type ad.
The ad command is used to execute commands within the AntDepo framework.
Options
Typing ad -h will print the ad usage:
$ ad -h usage: ad [-h] [-v] [-V] [-p project -t type -o object -c command] [-m module -c command] -V run verbose and invoke ant using -invoke flag -c command -h display this help -m module name -o entity object name -p project name -t entity type name -v run verbose
When no arguments are specifed, AntDepo looks for any projects where objects have been created and any modules that have been installed and lists them.
Listings with ad
When you login to a machine that has AntDepo installed, one often wants to know what commands can be run via ad.
The ad command helps you navigate to contexts from which commands can be run. The example below demonstrates ad's built in listing capability to navigate to run the Status command for the staging HNTomcat object in the headlines project:
$ ad #Available projects: headlines $ ad -p headlines #Available types in project: HNBuilder HNMysql HNMysqlSchema HNSite HNTomcat HNUpdater $ ad -p headlines -t HNTomcat #Available instances for type: staging $ ad -p headlines -t HNTomcat -o staging #Available commands in module: Configure Docs-Generate Docs-Verify Get-Properties Install Packages-Install Prepare Register Start Status Stop Update assertServiceIsDown assertServiceIsUp runShutdownScript sendShutdownMessage startService stopService $ ad -p headlines -t HNTomcat -o staging -c Status UP
Files and Environment Variables | ||
Wrapper scripts exist for Unix and Windows to run the ad launcher. These launcher scripts read an initialization profile. For Unix OSes, the $ANTDEPO_BASE/etc/profile file is read. On Windows, %ANTDEP_BASE%\etc\profile.bat is called. These files are created by the AntDepo setup command but can be used to set needed environment variables.
The wrapper scripts use the following environment variables:
- ANTDEPO_HOME - full path to the AntDepo software install base
- ANTDEPO_BASE - full path to the AntDepo repository base
Default Commands - Managed-Entity Module | ||
The AntDepo framework includes a command module called, Managed-Entity, containing a set of commands that provide all objects some very basic capabilities. One can think of these as default or built-in commands available to any object.
| Name | Description |
|---|---|
| Install | Creates an instance of the specified type and stores it in the local repository. Sets up a standard directory structure, installs the module if needed, and obtains object properties. This command makes use of Install-Module and Get-Properties. |
| Install-Module | Installs the module specified by name and version into the module library. |
| Properties | Prints out all object properties obtained from Get-Properties |
| Get-Properties | Obtains the object properties |
| Purge | Deletes the specified object from the local repository. The Purge command first archives the ${entity.instance.dir} of the object to $ANTDEPO_BASE/var/removed-objects. |
Examples
ad -p myproj -m HelloModule -o hi -c Install ad -p myproj -m HelloModule -o hi -c Properties

