Bitbucket File

A Bitbucket file artifact is a reference to a file stored in Bitbucket.

These artifacts are generally consumed by stages that read configuration from text files, such as a Deploy Manifest stage.

Bitbucket file artifact in the UI

The pipeline UI exposes the following fields for the Bitbucket file artifact:

FieldExplanation
AccountA Bitbucket artifact account.
File pathThe full path (including filename) for retrieval via the Bitbucket API. Example: https://api.bitbucket.org/2.0/repositories/$ORG/$REPO/src/$VERSION/$FILEPATH.

In a trigger

When configuring certain triggers, you can use a Bitbucket file as an expected artifact.

Configuring Bitbucket file fields in a pipeline trigger’s expected artifact settings.

Configuring Bitbucket file fields in a pipeline trigger’s expected artifact settings.

In a pipeline stage

When configuring a “Deploy (Manifest)” or “Deploy” stage, you can use a Bitbucket file as a manifest or application artifact. You can either use a previously-defined artifact (for example, an artifact defined in a trigger) or define an artifact inline.

Bitbucket file artifact in a pipeline definition

The following are the fields that make up a Bitbucket file artifact:

FieldExplanation
typeAlways bitbucket/file.
referenceThe full path (including filename) for retrieval via the Bitbucket API. Example: https://api.bitbucket.org/2.0/repositories/$ORG/$REPO/src/$VERSION/$FILEPATH.
nameThe path to the file within your repository. Example: path/to/file.yml.
versionN/A–must be specified in reference.
locationN/A.

The following is an example JSON representation of a Bitbucket file artifact, as it would appear in a pipeline definition:

{
  "type": "bitbucket/file",
  "reference": "https://api.bitbucket.org/2.0/repositories/org/repo/src/master/manifests/config.yaml",
  "name": "manifests/config.yaml"
}