Dashboard > Pulse v1.2 > ... > Agents > Resource Repository
  Pulse v1.2 Log In | Sign Up   View a printable version of the current page.  
  Resource Repository
Added by Jason Sankey, last edited by Jason Sankey on Sep 30, 2007  (view change)
Labels: 
(None)

Pulse Manual Index

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:

  1. by introduction into the environment: e.g. you can introduce a property named "JAVA_HOME" into the environment to test against a specific JDK.
  2. 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
  3. by implicit references from certain commands: e.g. the ant command will look for a resource named "ant"
  4. 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 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.

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. This will take you to the Add Resource Wizard. Step one of the wizard prompts you for the type of resource to configure. There are several options, each described in more detail in the subsections below.

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.

Ant Resources

An "ant" resource is used to describe an installation of Apache Ant. To configure an Ant resource, enter the location of the Ant installation directory (the same directory that you would point the environment variable ANT_HOME to). Ant resources may be implicitly imported when using Ant Projects or the ant command.

Custom Resources

A custom resource can be used to configure an arbitrary tool. When adding a custom resource, you need only specify the resource name. You are then able to configure whatever versions and properties you require.

Java Resources

A "java" resource is used to describe an installation of a Java runtime, either a JRE or JVM. To configure a Java resource, enter the location of the Java installation directory (the same directory that you would point the environment variable JAVA_HOME to).

Maven Resources

A "maven" resource is used to describe an installation of Apache Maven, version 1. To configure a Maven resource, enter the location of the Maven installation directory. Maven resources may be implicitly imported when using Maven Projects or the maven command.

Maven2 Resources

A "maven 2" resource is used to describe an installation of Apache Maven, version 2. To configure a Maven 2 resource, enter the location of the Maven 2 installation directory. Maven 2 resources may be implicitly imported when using Maven 2 Projects or the maven2 command.

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 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. To set the default version, click the "edit resource" link in the top right corner of the resource view, and select the version from the drop down list provided.

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 the following additional options:

Option Description
add to environment If checked, the property will be added as an environment variable when imported. This is independent and in addition to of the PULSE_ version of the property which is added automatically to the environment (see the Properties for details).
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.
resolve variables If checked, the property value will have variables resolved, using the ${<property name>} syntax. These variables can be properties introduced from any source, including properties in every build (e.g. ${build.number}), environment variables (${env.PATH}) and so on.

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.

Zutubi wiki is Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.10 Build:#528 Nov 29, 2006) - Bug/feature request - Contact Administrators