Skip to content
BitBucket pull request resource for Concourse CI
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
Dockerfile
LICENSE
README.md
jest.config.js
package.json
tsconfig.json
tsconfig.spec.json
tslint.json
yarn.lock

README.md

BitBucket Pull Request Resource

Tracks BitBucket Pull Requests made to a particular repo.

Deploying to Concourse

You need to add the resource type to your pipeline:

resource_types:
  - name: bitbucket-pullrequest
    type: docker-image
    source:
      repository: halternz/bitbucket-pullrequest-resource

Source Configuration

  • username: Required. BitBucket username.

  • password: Required. BitBucket password.

  • project: Required. BitBucket project.

  • repository: Required. BitBucket repository.

  • git: Required. configuration is based on the Git resource. The branch configuration from the original resource is ignored.

Example

Resource configuration for pull requests against this repository:

resources:
  - name: pull-request
    type: bitbucket-pullrequest
    source:
      username: ((bitbucket-username))
      password: ((bitbucket-password))
      project: halternz
      repository: bitbucket-pullrequest-resource
      git:
        uri: git@bitbucket.org:halternz/bitbucket-pullrequest-resource.git
        private_key: ((bitbucket-ssh-private-key))
    webhook_token: ((webhook-token))
    check_every: 24h

Example pull request build flow:

jobs:
  - name: pull-request
    serial: true
    plan:
      - aggregate:
        - get: tasks
        - get: pull-request
          version: every
          trigger: true
      - put: pull-request
        params:
          state: INPROGRESS
          name: concourse ci
          path: pull-request
      - do:
        - task: unit-test
          file: tasks/unit-test.yml
          input_mapping: {src: pull-request}
        on_failure:
          put: pull-request
          params:
            state: FAILED
            name: concourse ci
            path: pull-request
        on_success:
          put: pull-request
          params:
            state: SUCCESSFUL
            name: concourse ci
            path: pull-request

Behavior

check: Check for new pull requests

Open pull requests against the chosen repository are fetched from BitBucket. If new commits get added to the pull request a new version will be emitted.

in: Clone the repository, at the given ref.

Clones the repository to the destination, and locks it down to a given ref. It will return the same given ref as version.

out: Update build status of pull request.

Update the build status of pull request with desired state.

Parameters

  • state: Required. The state to set on the pull request, must be one of: INPROGRESS, SUCCESS or FAILED

  • path: Required. Path to the pull request input.

  • name: Required. The name of the build result.

  • description: Optional. Description of the build result.

You can’t perform that action at this time.