The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Start pipeline via strapi Webhook

Martin Pätzold
March 3, 2022

Hi Community,

following tech stack is used at the moment:
strapi headless cms
nuxt static site generator

I would like to use the strapi webhook to start a new pipeline to generate the nuxt full static site if some new content has been published. I tried to find a solution via bitbucket documentation, but it already fails at the authorization to perform an API call.

Do you have any best practises to get this working?

Many thanks in advance

Martin

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 6, 2022

Hi @Martin Pätzold 

Thank you for contacting Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you! Welcome to the Atlassian Community!

I'd like to inform you the best way to start Pipeline is with an API call, let me give you an example for an API call, that you can use the start Pipelines:

curl -X POST -is -u username:apppassword -H 'Content-Type: application/json' https://api.bitbucket.org/2.0/repositories/workspaceid/repositoryname/pipelines/ \
-d '
{
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "branchname"
}
}'

By doing this API call, you're starting Pipelines on "workspaceid/repositoryname" repository, on the "branchname" branch. You can generate an app password by following the steps in this documentation: https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/

Please let me know how it goes.

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

Martin Pätzold
March 7, 2022

Hi @Norbert Csupka , thank you very much for your feedback. I've already found out how the authorization works. I'm using the app-password method, too.

With your help I'm now able to start the pipeline :)

Best regards,
Martin

Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 7, 2022

You're welcome @Martin Pätzold I'm glad to hear I was able to assist you.

Stay safe and have a great week ahead!

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

TAGS
AUG Leaders

Atlassian Community Events