Tracks pull requests made to a particular github repo. In the spirit of Travis CI, a status of pending, success, or failure will be set on the pull request, which much be explicitly defined in your pipeline.
In your bosh deployment manifest, add to the groundcrew.additional_resource_types
with the following:
- image: docker:///jtarchie/pr
type: pull-request
-
repo
: Required. The repo name on github. Example:jtarchie/pullrequest-resource
-
access_token
: Required. An access token withrepo:status
access. -
base_url
: Optional The base URL for the Concourse deployment, used for linking to builds. If not present, no link is provided on the Github pull request. -
private_key
: Optional. Private key to use when pulling/pushing. Example:private_key: | -----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAtCS10/f7W7lkQaSgD/mVeaSOvSF9ql4hf/zfMwfVGgHWjj+W <Lots more text> DWiJL+OFeg9kawcUL6hQ8JeXPhlImG6RTUffma9+iGQyyBMCGd1l -----END RSA PRIVATE KEY-----
New pull requests that have no concourseci
status messages are pulled in.
Since the nature of Concourse is to always have the latest version, some jiggery
pokery was done to allow iteration of each pull request.
Clones the repository to the destination, and locks it down to a given ref.
Submodules are initialized and updated recursively.
Set the status message for concourseci
context on specified pull request.
-
path
: Required. The path of the repository to reference the pull request. -
status
: Required. The status of success, failure, error, or pending.
This is what I am currently using to test this resource on Concourse.
resources:
- name: repo
type: pull-request
source:
access_token: acecss_token
private_key: |
-----BEGIN RSA PRIVATE KEY-----
My private key.
-----END RSA PRIVATE KEY-----
repo: jtarchie/pullrequest-resource
jobs:
- name: test pull request
plan:
- get: repo
trigger: true
- put: repo
params:
path: repo
status: pending
- task: do something with git
config:
platform: linux
image: docker:///concourse/git-resource
run:
path: sh
args:
- -c
- cd repo && git --no-pager show
inputs:
- name: repo
path: ""
- put: repo
params:
path: repo
status: success