I am trying to trigger and define a pipeline type (default, pr, branches, tags, etc.) dynamically, that is this pipeline configuration type doesn't exist in my bitbucket.yml file. The use case is that I'd like a pipeline to be triggered if a pull-request doesn't exist, and if one does exist I don't want it to be triggered and only want the pr pipeline to be triggered.
I have thought of creating a default pipeline object and definition and assign it to the pipeline configuration object. Alternatively, I have thought of deleting an already present default step if a PR exists so that two pipelines (default and PR) aren't triggered simultaneously. I am in the process of trying out both these ideas. Please let me know if this is the way to go and if there is a better way out there to trigger and define a pipeline configuration entirely dynamically.
I think you could try calling the Bitbucket REST API, specifically the end-points related to pull request, from the pipeline. That way the pipeline itself could decide if the PR already exists and change his behavior accordingly.
We gave it a try and it didn't work as expected. The Bitbucket API part we had figured out already. I have posted a more in-depth information about the issue in this post: Dynamic Pipeline and Bitbucket API Integration leading to erratic behaviour.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.