Although, I've been through many of the related questions here, I cannot figure out what I'm doing wrong.
I've set up a test repository at https://bitbucket.org/<my-workspace>/<my-test-repo>.
Then I've added a custom pipeline (bitbucket-pipelines.yml)
image: atlassian/default-image:3
pipelines:
custom:
configure:
- variables:
- name: TENANTS
- name: STAGE
- step:
name: configure-create-and-campus
script:
- chmod +x scripts/reconfigure.sh
- scripts/reconfigure.sh some
- scripts/reconfigure.sh other
Triggering the pipeline manually from the Bitbucket Admin Interface works.
Then I've created an Access Token for the repo with pipeline:write permissions.
Then I've tried to query against the Bitbucket API endpoint, like stated in your REST API Docs via Postman. The Authorization Bearer Token has been added.
Endpoint: https://api.bitbucket.org/2.0/repositories/<my-workspace>/<my-test-repo>/pipelines/
My request body looks like so
{
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "master",
"selector": {
"type": "custom",
"pattern": "Using parameter for tenants"
}
},
"variables": [
{
"key": "TENANTS",
"value": "[\"codeversity.com\",\"sycademy.com\",\"heartbase.at\",\"tangoamadeus.com\", \"verbund.sycademy.com\",\"kaidoo.com\",\"blockademy.net\",\"oecademy.codeversity.com\",\"neeom.codeversity.com\",\"hb-tischler.heartbase.at\"]"
},
{
"key": "STAGE",
"value": "testing"
}
]
}
Unfortunately, the request I get is always
{
"error": {
"message": "Bad request",
"detail": "bitbucket-pipelines.yml not found.",
"data": {
"key": "result-service.pipeline.yml-not-found",
"arguments": {}
}
}
}
Any ideas?
Any help much appreciated! 🙌
I found the solution - and I have to admit, that it pretty obvious 🙈
I have set the wrong pipeline name as a pattern:
pipelines:
custom:
configure: <-- this is the pipe name
...
so the request body should be
{
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "master",
"selector": {
"type": "custom",
"pattern": "configure" <-- this is where the name goes
}
},
...
}
Maybe this helps someone!
@Flo Ragossnig hi.
This is a good idea to start using pipes. Here is an example of using a trigger-pipeline pipe:
- pipe: atlassian/trigger-pipeline:5.3.0 variables: BITBUCKET_USERNAME: $BITBUCKET_USERNAME BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD REPOSITORY: 'your-awesome-repo'
To discover more pipes, visit our Bitbucket Pipes Marketplace.
Regards, Igor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, I've read this but unfortunately this does not solve the problem. I have set up everything already, it just does not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.