atlassian-python-api - How to trigger pipeline using pattern?

442 Views Asked by At

In my project I host at the bitbucket I have such bitbucket-pipelines.yml file:

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

I would like to trigger the pipeline with the release-* steps using the atlassian-python-api. However each time I try to do this I get requests.exceptions.HTTPError: 400 Client Error: Bad Request for url. My code looks like this:

  bitbucket = Cloud(url=URL, username=USERNAME, password=PASSWORD, cloud=True)
    r = bitbucket.workspaces.get(WORKSPACE).projects.get(PROJECT).repositories.get(REPOSITORY)
    t = r.pipelines.trigger(
        branch="master",
        commit="<COMMIT HASH>",
        pattern="release-*"
    )

How to change the pattern so I'll be able to run the release-* pipeline ?

0

There are 0 best solutions below