SHyx0rmZ / bitbucket-build-status-resource

A Concourse resource for interacting with Bitbucket servers
Other
19 stars 14 forks source link

Add support for Concourse instanced pipelines in Bitbucket status url #15

Closed kardashov closed 2 years ago

kardashov commented 2 years ago

We use multi-branch workflow in Concourse similar to what is described here https://concourse-ci.org/multi-branch-workflows.html.

When build-status-resource is used from inside instanced pipeline, it generates invalid url.

For example, when there is an instance variable "git-branch", build status link should look like this:

https://myconcourse.org/teams/myteam/pipelines/my-service_branches/jobs/run-tests-my-service/builds/5?vars.git-branch=%22mybranch%22 (note url parameters ?vars.git-branch=%22mybranch%22)

and NOT https://myconcourse.org/teams/myteam/pipelines/my-service_branches/jobs/run-tests-my-service/builds/3 (this URL lead to non-existing job)

I propose to addionaly check if $BUILD_PIPELINE_INSTANCE_VARS is present and add respective URL parameters to generated Concourse url:
https://github.com/SHyx0rmZ/bitbucket-build-status-resource/blob/master/scripts/out#L73

SHyx0rmZ commented 2 years ago

I have merged your pull request and released v1.6.0. Thanks for taking care of this!