atlassian-python-api
atlassian-python-api copied to clipboard
Allow different selector types when triggering bitbucket pipeline
Currently when triggering pipeline the selector is hardcoded to be custom - https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/bitbucket/cloud/repositories/pipelines.py#L54 - it causes that it's not possible to trigger pipeline by a tag.
Example case would be a bitbucket-pipelines.yml like this:
pipelines:
default:
- step:
name: "Test and build"
...do something
- step:
name: "Deploy to test"
...do something
tags:
release-*:
- step:
name: "Test and build"
...do something
- step:
name: "Deploy to test"
...do something
- step:
name: "Deploy to prod"
...do something else
And I would like to trigger the release-* pipeline. It's possible by the rest api by just sending a request like:
{
"target":{
"type":"pipeline_ref_target",
"ref_type":"branch",
"ref_name":"master",
"commit": {
"type": "commit",
"hash": "<SOME HASH>"
},
"selector":{
"type":"tags",
"pattern":"release-*"
}
}
}
but it's not possible while using your library.
If I get the docs right you can use this as pattern. I'm missing the enumeration of selector values in the docs. https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines/#post