Overview
The apply tag task can be used to tag (or label) the built revision when a stage or build completes. When the task is executed, it will apply a tag to all source files used in the build at the revisions that were built. Typical use cases include:
- tagging all builds with the project name and build number: so that your SCM has a record of all built revisions
- maintaining a "last known good" tag: by tagging only after successful builds with a moving tag (see the "move existing tag" option below)
Properties
Usually the tag name you would like to apply will be specific to the build or stage that your hook is executing against. To achieve this, your tag task configuration can reference the build properties as described on the Project Build Hooks page. Properties are refered to using the ${...} syntax, as used in pulse files.
Examples
To tag every build, add unique build details in the tag name:
For a moving "last-known-good" tag for the project, ensure the hook only triggers after successful builds, check the "move existing tag" box, and set the tag name to:
Compatible Hook Points
The tag action cannot be run pre-build as the build revision is not yet available.