Hi community
I want to send a curl request to trigger a pipeline in one of the repositories we managed, the curl command is this, based on the api reference docs https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#trigger-a-custom-pipeline-with-variables
curl -X POST -is -u "$BITBUCKET_USERNAME":"$BITBUCKET_APP_PASSWORD" \
--header 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/pipelines/ \
--data '
{
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "develop",
"selector": {
"type": "custom",
"pattern": "Deploy to integration"
}
},
"variables": [
{
"key": "NAMESPACE",
"value": "enrx_org_013"
},
{
"key": "URL",
"value": "https://api.xx.xxx.net/"
},
{
"key": "KID",
"value": "xxxxx"
}
],
"WAIT": true
}'
But I got this error
{"error": {"message": "Bad request", "detail": "bitbucket-pipelines.yml not found.",
"data": {"key": "result-service.pipeline.yml-not-found", "arguments": {}}}}
It is like the `bitbucket-pipelines.yml` wouldn't exist in the repository where I am trying to trigger the pipeline, but it does. Could be that apparently the payload I am providing on the curl command is incorrect in somehow?
How can I get this curl request properly formed?
Got it. At the selector attribute, in the `pattern` sub key I had to provide the name of the existing pipeline on `bitbucket-pipelines.yml` file I want to be called to be executed on the request.
I was doing this
"selector": {
"type": "custom",
"pattern": "Deploy to integration"
}
I need to do this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.