Skip to content

BitBucket pull request resource for Concourse CI

License

Notifications You must be signed in to change notification settings

halter-corp/bitbucket-pullrequest-resource

Repository files navigation

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: [email protected]: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.

About

BitBucket pull request resource for Concourse CI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published