Overview
The resource repository for each pulse™ agent is where you can view and edit the resources for that agent. The repository is found in the "resources" tab in the "agents" section 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 verion.
- A specific version of the Linux kernel, for builds targetted 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 loction 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. There are two ways to import resources:
When a resource is imported, all properties for the default version of the resource are 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 default properties. Properties defined in both the default and specific version will take on the value in the specific version.
For built-in projects, resources may be implicitly referenced (i.e. without being imported). For example, an ant project will import a resource named "ant" (if it exists) and the ant command will use a property named "ant.bin" if it exists. Thus to control the ant binary used by an ant project, you can define a resource named "ant" with a property named "ant.bin". For full details on how each type of built-in project interacts with the resource repository, refer to the page for the specific project type.
Creating Resources
To create a new resource, click the "add new resource" link at the bottom of the "resources" table. The resource requires just one field: a name.
 | Resource Names
You can choose whatever name for your resource you like. However, some conventions are used by various built-in projects and commands. For example, resources named "ant", "make" and "maven" are treated specially by the correcponding commands and project types. |
 | 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
To manage a resource, click the "edit" link in the appropriate row of the "resources" table. You will be taken to the Resource View, which displays all versions of the resource along with the properties for each version. You can delete a resource using the "delete" link in the appropriate row of the "resources" table.
Managing Versions
To add a new version to a resource, click the "add new version" link in the left hand column of the "versions" section of the page. You will be prompted to enter a value for the version, which may be an arbitrary string. Typically, you will enter a version number such as "1.0", but you can use whatever value is customary for the resource.
To delete a version, click the "delete version" link at the bottom of the version information.
Default Version
Note that all resources always have at least one version, known as the "default" version. The properties for this version are inherited by all other versions of the resource, although they may be overidden by defining a property of the same name in a specific version. If the resource is referenced in a pulse file without a version being specified, the properties from the default version are imported.
Note that built-in projects always import the default version of a resource.
Managing Properties
You can add a new property to a resource version by clicking the "add new property" link at the bottom of the corresponding "properties" table. You will be prompted for a property name and value. The property name is required and is used to reference the property in pulse files. The value is optional, and is substituted where the property is referenced by name. Properties also expose two additional options:
| Option |
Description |
| add to environment |
If checked, the property will be added as an environment variable when imported. |
| add to search path |
If checked, the property value will be added to the start of the search path used by pulse™ to locate executables. |
Properties may be deleted using the "delete" link in the appropriate row of the "properties" table.
 | Property Names
Some conventions are used for property names, particularly those used by built-in projects and some commands (such as ant). 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. |