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

Pulse Manual Index

Properties

Properties are used throughout pulse™ as a way to specify a named value. This value can then be referenced in various contexts by using a special syntax:

${<property name>}

By abstracting a value with a property, the value can be substituted with different values depending on when and where the property is referenced.

Types of Properties

The most frequently used properties in pulse™ are the properties available within pulse files. As built-in projects are implemented by generating pulse files, these properties are also available to those projects. This type of property can be defined in various ways, see below for details.

Additionally, various areas of configuration within pulse™ also have their own special properties, tailored to a specific purpose. For example, when configuring post-build actions, various build-specific properties are made available to the action configuration. These special properties are referenced using the same syntax, and are documented within the pulse™ web interface. As these properties are specific to the context where they are used, they are omitted in the discussion below.

Defining Properties

Properties available to pulse files can be defined in various ways:

  • By using the property element directly in the pulse file. For more details, refer to the property page.
  • By defining them on a resource, and importing that resource for the build. Properties introduced in this way are usually used to abstract the location of a build dependency (e.g. to allow the dependency to be installed in different locations on different agents.)
  • By defining them as build properties on a build specification. Such properties can be used to parameterise the project configuration for different specifications (e.g. to build different targets), and can also be used to manually specify properties for special types of builds.

Although the mechanisms differ, the resulting properties behave in the same way when referenced in the pulse file.

Referencing Properties

Properties may be referenced within pulse files using the syntax described above: ${<property name>}. This syntax may be used both within attribute values, and within text content between tags. Properties may also be referenced within project configuration that is used to generate a pulse file. In particular, when configuring the details of built-in projects, you can reference properties. A typical use for this would be to parameterise the targets executed as part of a build. Instead of fixing the target in the project configuration, use a reference to a variable, e.g. ${target}. Then, specify the different targets for different build specifications using build properties.

To see how your property references appear within a pulse file, you can view the pulse file generated for a build as part of the build result. This may aid in using properties during configuration.

Environment Variables

All properties are also available as environment variables in build processes. Pulse automatically converts the property names as follows:

  • The name is converted to upper case
  • All periods (.) are replaced with underscores (_)
  • PULSE_ is prepended

For example, a property named "my.property" would become "PULSE_MY_PROPERTY" in the environment.

Note that you can also introduce environment variables into the build using resource properties that are marked as "add to environment". In this case the resource property is added to the environment as-is (without converting the name) in addition to the normal PULSE_ version of the property.

Built-in Properties

Various properties are automatically made available by pulse™ to all builds. Note that these are also introduced as variables into the environment of child processes, by converting the names as shown.

Property Environment Variable Value Availability
agent PULSE_AGENT The name of the agent the build is running on. Not available for local builds.
base.dir PULSE_BASE_DIR The absolute path of the base directory for the working copy being built. Always available.
build.number PULSE_BUILD_NUMBER The number (or id) for the build being executed. Not available for local builds.
build.reason PULSE_BUILD_REASON The reason the build was started, e.g. "manual trigger by bob". Not available for local builds.
build.revision PULSE_BUILD_REVISION The revision of the source used for the build. Not available for local builds.
build.timestamp PULSE_BUILD_TIMESTAMP The time that the build commenced, in the format yyyy-MM-dd HH:mm. Not available for local builds.
build.timestamp.millis PULSE_BUILD_TIMESTAMP_MILLIS The time that the build commenced, as the number of milliseconds since midnight, January 1, 1970 UTC. Not available for local builds.
build.trigger PULSE_BUILD_TRIGGER If the build was started by a configured trigger, the name of that trigger. Not available for local builds.
cvs.branch PULSE_CVS_BRANCH The CVS branch configured for the project. CVS projects only, not available for local builds.
cvs.module PULSE_CVS_MODULE The CVS module configured for the project. CVS projects only, not available for local builds.
cvs.root PULSE_CVS_ROOT The CVS root configured for the project. CVS projects only, not available for local builds.
env.* * A property for every environment variable in the pulse™ process just before the recipe is commenced, e.g. env.PATH. Environment variable names are normalised to upper case. Always available.
master.url PULSE_MASTER_URL The url of the master agent, determined by the master location. The user includes "http://" and will never end with a slash. Not available for local builds.
project PULSE_PROJECT The name of the project being built. Not available for local builds.
recipe PULSE_RECIPE The name of the recipe being executed, may be "[default]" if no recipe name was explicitly specified. Not available for local builds.
recipe.timestamp PULSE_RECIPE_TIMESTAMP The time that the recipe commenced, in the format yyyy-MM-dd HH:mm. Always available.
recipe.timestamp.millis PULSE_RECIPE_TIMESTAMP_MILLIS The time that the recipe commenced, as the number of milliseconds since midnight, January 1, 1970 UTC. Always available.
specification PULSE_SPECIFICATION The name of the build specification being built. Not available for local builds.
specification.build.count PULSE_SPECIFICATION_BUILD_COUNT The number of times the build specification has previously been built (includes builds that have since been deleted). Not available for local builds.
specification.success.count PULSE_SPECIFICATION_SUCCESS_COUNT The number of times the build specification has previously been built successfully (includes builds that have since been deleted). Not available for local builds.

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