Skip to content
Concourse resource, which outputs build metadata to files.
Shell Dockerfile
Branch: master
Clone or download
Latest commit f86c1d4 Apr 27, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml Bump to 2.0.1 Apr 27, 2019
Dockerfile Fix script permissions Mar 18, 2017
LICENSE Create LICENSE Apr 11, 2019 Update Nov 24, 2018
check Emit empty versions, fixes #1 Nov 24, 2018
in Emit proper version in get and put steps; fixes #2 Apr 27, 2019
out Emit proper version in get and put steps; fixes #2 Apr 27, 2019

Metadata Resource

Build Status

This resource outputs build metadata to files to make annotations easier. One such use-case may be to add build links to the body of GitHub releases.

As Concourse documentation states, avoid using this for versioning. Use the semver resource instead.


⚠️ Since 2.0.0 a put step has to used instead of a get to fix this issue. If you want the old behaviour, use version 1.0.0 of this resource. ⚠️

check: Not used

Always emits an empty version.

in: Output metadata to files

Outputs $BUILD_ID, $BUILD_NAME, $BUILD_JOB_NAME, $BUILD_PIPELINE_NAME, $BUILD_TEAM_NAME and $ATC_EXTERNAL_URL to files build_id, build_name, build_job_name, build_pipeline_name, build_team_name and atc_external_url respectively.

out: Not used


The following example shows how a GitHub release can be created with a link pointing to the build.

# Register the metadata resource type
  - name: metadata
    type: docker-image
      repository: olhtbr/metadata-resource
      tag: 2.0.0

  # The resource does not need any configuration
  - name: metadata
    type: metadata

  # GitHub release resource
  # Check for more info
  - name: release
    type: github-release
      owner: my-github-user
      repository: my-github-repo
      acces_token: github-access-token
      # other settings...

  - name: prepare-release
      - put: metadata
      - get: release

      - task: setup-release-properties
          platform: linux
            type: docker-image
              repository: busybox

            - name: metadata

          # A URL to the build and other release properties
          # will be available as files in the properties folder
            - name: properties

            path: sh
              - -exc
              - |
                # Grab the metadata
                url=$(cat metadata/atc_external_url)
                team=$(cat metadata/build_team_name)
                pipeline=$(cat metadata/build_pipeline_name)
                job=$(cat metadata/build_job_name)
                build=$(cat metadata/build_name)

                # Generate the build URL to a file
                echo $url/teams/$team/pipelines/$pipeline/jobs/$job/builds/$build > properties/body

                # Write the release name to a file
                echo v1.0.0 > properties/name

                # The tag must already exist in git
                echo 1.0.0 > properties/tag

      # The put step creates a new GitHub release at the specified tag and
      # its body will contain a link to the current build
      - put: release
          name: properties/name
          tag: properties/tag
          body: properties/body
You can’t perform that action at this time.