This is what I execute:
curl -X POST -i -u '<username>:<password>' -H 'Content-Type: application/json' https://api.bitbucket.org/2.0/repositories/<workspace>/<slug>/pipelines/ -d '
{
"target": {
"type": "pipeline_ref_target",
"ref_type": "branch",
"ref_name": "master",
"selector": {
"type": "custom",
"pattern": "increment-build-version"
}
}
}'
This is what I receive:
{"error": {"message": "Bad request", "detail": "bitbucket-pipelines.yml not found.", "data": {"key": "result-service.pipeline.yml-not-found", "arguments": {}}}}
But, I have a bitbucket-pipelines.yml file and custom pipelines defined like so:
pipelines:
custom:
new-start-testflight:
- step:
name: New Test Flight
image: atlassian/default-image:2
script:
- ./prepTestFlight.sh
increment-build-number:
- step:
name: Increment Build Version
image: atlassian/default-image:2
script:
- git remote set-url origin ${BITBUCKET_GIT_SSH_ORIGIN}
- ./incrementBuildVersion.sh