GithubHelp home page GithubHelp logo

hippolin / concourse-git-bitbucket-pr-resource Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zarplata/concourse-git-bitbucket-pr-resource

0.0 2.0 0.0 18 KB

:rocket: Concourse CI resource for tracking git branches for Bitbucket pull-requests

License: MIT License

Dockerfile 2.30% Shell 97.70%

concourse-git-bitbucket-pr-resource's Introduction

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
  • username: Required. username of the user which have access to repository.
  • password: Required. password of that user
  • 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: Optional. set to name of the resource if resource name is different than repository name

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:
            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:
            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 specifying source.branch as the branch that changed, and version.ref as the commit on the branch.

All params and source configuration of the original resource will be respected.

out: Update build task status.

This updates the build status of the task.

concourse-git-bitbucket-pr-resource's People

Contributors

idr0id avatar ollieh avatar philicious avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.