This repo has been forked from pickledrick/concourse-bitbucket-pullrequest-resource
A Concourse resource to interact with the build status API of Atlassian BitBucket.
This repo is tied to the associated Docker image on quay.io, built from the master branch.
These items go in the source
fields of the resource type. Bold items are required:
repo
- repository name to trackkey
- OAuth key for Consumersecret
- OAuth Secret for Consumerteam
- Team name repository belongs tourl
- bitbucket cloud api path (example:https://api.bitbucket.org
) Currently only supportedversion
- bitbucket API Version (example:2.0
) Currently only supportedconcourse_url
- concourse url for setting build link in bitbucket (example:http://ci.example.com
)
Checks for a Pull request with a head commit in an untested state.
Retrieves a copy of the tracking branch, sets pull request state to IN_PROGRESS.
Update the status of a commit.
Parameters:
commit
- File containing commit SHA to be updated.state
- the state of the status. Must be one ofsuccess
,failed
orinprogress
. By usinginprogress
we can use this resource purely as anput
in order to update status of a bitbucket commit. Make sure to, if you putinprogress
for a task, then also dosuccess
with the same task. Otherwise, bitbucket will consider them two different builds (so theinprogress
one will never succeed).
The logs can be found by running fly -t <target-name> intercept -c <pipeline-name>/<resource-name>
and then looking for check_logfile.txt
, in_logfile.txt
and out_logfile.txt
in the ~/root/
directory.
A typical use case is to watch for Pull Requests on a Repository, Run Tests and update the status of a commit.
An example of this is shown in ci/pipeline.yaml
This resource is not included with the standard Concourse release. Use one of the following methods to make this resource available to your pipelines.
To install on all Concourse workers, update your deployment manifest properties to include a new groundcrew.resource_types
entry...
properties:
groundcrew:
additional_resource_types:
- image: "docker:///quay.io/pontusarfwedson/concourse-bitbucket-pullrequest-resource#latest"
type: "pull-request"
To use on a single pipeline, update your pipeline to include a new resource_types
entry...
resource_types:
- name: "pull-request"
type: "docker-image"
source:
repository: "quay.io/pontusarfwedson/concourse-bitbucket-pullrequest-resource"
tag: "latest"