Overview
The resource repository for each pulse™ agent is where you can view and edit the resources for that agent. The repository is found nested in the "resources" item in the agent's configuration found in the "administration" of the web interface.
Purpose of Resources
Resources are used to describe external requirements for executing builds. Examples of resources include:
- The Apache Ant
build tool, perhaps a specific version.
- A specific version of the Linux kernel, for builds targeted at that kernel.
- A runtime library required to execute the tests for the build.
By adding a resource to the repository on an agent, you can indicate that the resource exists on that server. Additionally, you configure properties for the resource (or specific versions of the resource), and those properties may be accessed when processing recipes. Properties can influence the build in multiple ways:
- by introduction into the environment: e.g. you can introduce a property named "JAVA_HOME" into the environment to test against a specific JDK.
- by influencing the search path: e.g. you can create a property "ant.bin.dir" which can be added to pulse's executable search path to test using a specific version of Ant
- by implicit references from certain commands: e.g. the ant command will look for a resource named "ant"
- by explicit references in pulse files
Resources allow you to abstract the specific location of a required resource on different agents, and to test against multiple versions of various dependencies.
Accessing Resource Properties
Resource properties are accessed by importing a resource (or a specific version of a resource) as part of a build. To import resources, add them as required resources for your project or specific build stage. All required resources are imported before recipe execution.
When a resource is imported, all global properties for the resource are always introduced. The properties may also be added to the environment and executable search path if so configured. When a specific resource version is imported, the properties for that version are introduced in addition to the global properties. Properties defined in both the globals and specific version will take on the value in the specific version. If no version is specified, and a version is marked as the default, the properties for the default version are introduced. Resources may be configured without a default version, in which case omitting the version on import will result in only the global properties being introduced.
Adding Resources
To create a new resource, navigate to the "resources" tree item on the configuration view for the appropriate agent and click the "add" link at the bottom of the "resources" table.
 | Resource Auto-Discovery
Note that when a pulse™ server starts, it may automatically detect resources installed on the host machine. Refer to Resource Auto-Discovery for details. |
Managing Resources
Default Version
Note that you can specify a default version for a resource. If no version is specified when the resource is imported, the default version will be used. Otherwise, only the global properties will be imported.
Property Names
Some conventions are used for property names, particularly those used by commands (such as the Ant Command). In particular, property names:
- should use the "." character as a word separator
- should end in ".bin" when referring to a binary
- should end in ".dir" when referring to a directory path
These conventions are not enforced, but following them is recommended.