All Projects â†’ zarplata â†’ concourse-git-bitbucket-pr-resource

zarplata / concourse-git-bitbucket-pr-resource

Licence: MIT License
🚀 Concourse CI resource for tracking git branches of Bitbucket pull-requests

Programming Languages

shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to concourse-git-bitbucket-pr-resource

concourse-build-resource
A Concourse resource for observing Concourse builds
Stars: ✭ 16 (-44.83%)
Mutual labels:  concourse, concourse-ci, concourse-resource, concourse-ci-resource
bender
A Concourse resource that can trigger and pass parameters to jobs using slack
Stars: ✭ 32 (+10.34%)
Mutual labels:  concourse, concourse-ci, concourse-resource, concourse-ci-resource
concourse-fly-resource
A Concourse resource for manipulating fly
Stars: ✭ 16 (-44.83%)
Mutual labels:  concourse, concourse-ci, concourse-resource
ofcourse
A Concourse resource generator
Stars: ✭ 41 (+41.38%)
Mutual labels:  concourse, concourse-ci, concourse-ci-resource
maven-resource
Maven Repository Manager Concourse Resource
Stars: ✭ 22 (-24.14%)
Mutual labels:  concourse, concourse-resource
ansible-concourse
An ansible role to manage Concourse CI
Stars: ✭ 22 (-24.14%)
Mutual labels:  concourse, concourse-ci
pulumi-resource
Pulumi Resource Type for Concourse
Stars: ✭ 16 (-44.83%)
Mutual labels:  concourse, concourse-resource
cogito
Another Concourse GitHub status resource
Stars: ✭ 21 (-27.59%)
Mutual labels:  concourse, concourse-resource
keyval-resource
a resource that passes key values between jobs
Stars: ✭ 39 (+34.48%)
Mutual labels:  concourse, concourse-ci
terraform-aws-concourse
Terraform Module for a distributed concourse cluster on AWS
Stars: ✭ 12 (-58.62%)
Mutual labels:  concourse, concourse-ci
prom-bitbucket-exporter
Prometheus Exporter for Bitbucket
Stars: ✭ 47 (+62.07%)
Mutual labels:  bitbucket
pivnet-resource
Concourse Resource to interact with the Tanzu Network API V2 interface.
Stars: ✭ 29 (+0%)
Mutual labels:  concourse-resource
terraform-provider-bitbucket
This Terraform provider is archived per our provider archiving process: https://terraform.io/docs/internals/archiving.html
Stars: ✭ 30 (+3.45%)
Mutual labels:  bitbucket
vscode-open-in-github
Visual Studio Code Extension — Open file in GitHub
Stars: ✭ 35 (+20.69%)
Mutual labels:  bitbucket
cloud-native-pipelines
Cloud-native pipelines leveraging Concourse, Pivotal Build Service and Spinnaker to deploy apps
Stars: ✭ 15 (-48.28%)
Mutual labels:  concourse
vpr
VPR is a CLI that helps you to quickly manage your project in GitHub/GitLab/Bitbucket
Stars: ✭ 17 (-41.38%)
Mutual labels:  bitbucket
froggit-go
Froggit-Go is a universal Go library, allowing to perform actions on VCS providers.
Stars: ✭ 19 (-34.48%)
Mutual labels:  bitbucket
mattermost-bitbucket-bridge
Flask application that serves as a bridge between Bitbucket and Mattermost.
Stars: ✭ 18 (-37.93%)
Mutual labels:  bitbucket
snipper
Manage Bitbucket snippets from command line easy
Stars: ✭ 25 (-13.79%)
Mutual labels:  bitbucket
oci-build-task
a Concourse task for building OCI images
Stars: ✭ 57 (+96.55%)
Mutual labels:  concourse

concourse-git-bitbucket-pr-resource

Tracks changes for all git branches for pull requests.

This resource is meant to be used with version: every.

Inspirited by git-branch-heads-resourse

Installation

Add the following resource_types entry to your pipeline:

---
resource_types:
- name: git-bitbucket-pr
  type: docker-image
  source:
    repository: zarplata/concourse-git-bitbucket-pr-resource

Source Configuration

  • base_url: Required. base URL of the bitbucket server, without a trailing slash. For example: http://bitbucket.local

  • project: Required. project for tracking

  • repository: Required. repository for tracking

  • limit: Optional. limit of tracked pull requests default: 100.

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

  • bitbucket_type: Optional. cloud for BitBucket Cloud or server for a self-hosted BitBucket Server. default: server

  • dir: Deprecated. set to name of the resource if resource name is different than repository name. Is deprecated in favor to params.repository in out.

  • branch: Optional. if given, only pull requests against this branch will be checked

  • paths: Optional. if specified (as a list of glob patterns), only changes to the specified files will yield new versions from check

  • changes_limit: Optional. the maximum number of changed paths loaded for each pull-request. default: 100. It works only with the paths parameter.

  • direction: Optional. the direction relative to the specified repository, either incoming (destination, e.g. to master) or outgoing (source, e.g. from feature). Either:

  • username: Required. username of the user which have access to repository.

  • password: Required. password of that user Or:

  • oauth_id: Required. Oauth id of an OAuth consumer configured as private and with permission to write to PRs.

  • oauth_secret: Required. Oauth secret of the same consumer.

  • exclude_title: Optional. prevent check from emitting new versions when only the pull request title changes, except when the string "WIP" is removed from the title.

Example

resources:
- name: my-repo-with-pull-requests
  type: git-bitbucket-pr
  source:
    base_url: http://bitbucket.local
    username: some-username
    password: some-password
    project: zarplata
    repository: concourse-git-bitbucket-pr-resource
    git:
      uri: https://github.com/zarplata/concourse-git-bitbucket-pr-resource
      private_key: {{git-repo-key}}

jobs:
  - name: my build
    plan:    
      - get: my-repo-with-pull-requests
        trigger: true
        version: every
      - task: unit test
          ...
          inputs:          
            - name: my-repo-with-pull-requests
          run:
          ...
        on_failure:
          put: my-repo-with-pull-requests
          params:
            action: change-build-status
            state: FAILED
            name: "unit test"
            url: "http://acme.com/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME"
        on_success:
          put: my-repo-with-pull-requests
          params:
            action: change-build-status
            state: SUCCESSFUL
            name: "unit test"
            url: "http://acme.com/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME"

Behavior

check: Check for changes to all pull requests.

The current open pull requests fetched from Bitbucket server for given project and repository. Update time are compared to the last fetched pull request.

If any pull request are new or updated or removed, a new version is emitted.

in: Fetch the commit that changed the pull request.

This resource delegates entirely to the in of the original Git resource, by passing through source.git to source of the original git-resource, then specifying source.branch as the branch that changed, and version.ref as the commit on the branch.

Parameters

All params, except the ones listed below, will be passed through to params of the original git-resource.

  • skip_download: Optional. Skip git pull. Artifacts based on the git will not be present.
  • fetch_upstream: Optional. Also fetch the pull requests' upstream ref. This will overwrite the fetch param.

out: Update the PR.

Behavior depends on the value of parameter action, where is the values are:

  • change-build-status: Change the commit build status.

    • action: Required. For this behavior should be change-build-status.
    • Parameters except the name will be respected the Bitbucket documentation.
    • name: Deprecated. Parameter is deprecated and has been left only for backward compatibility.
    • repository: Optional. The path of the source repository for changing build status.
  • push: Push the commit to pull request branch.

    • action: Required. For this behavior should be push.
    • repository: Optional. The path of the source repository for pushing.

Troubleshooting

  • Mark PR with "build started" creates a new version of a PR.

    The Concourse is not available to skipping versions but have the workaround. You should add the resource with the same settings as pull-request for changing the build status only.

    - name: test-pull-requests
      plan:
      - get: pull-request
        trigger: true
        version: every
      - get: node
      - put: pull-request-status
        params:
          action: change-build-status
          state: INPROGRESS
          key: concourse-build
          description: Building on Concourse
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].