PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, November 13, 2022

[FIXED] How to invoke Plesk Git extension webhook via cURL from Bitbucket Pipelines?

 November 13, 2022     bitbucket, bitbucket-pipelines, git, plesk     No comments   

Issue

Unfortunately, Bitbucket doesn't support per-branch webhooks and won't support them in the near future (https://bitbucket.org/site/master/issues/11728/trigger-webhook-only-for-push-to-specific).

So I thought I maybe could write a simple bitbucket-pipelines.yml which calls the corresponding webhook:

pipelines:
  branches:
    staging:
      - step:
          script:
            - curl $WEBHOOK_STAGING
    master:
      - step:
          script:
            - curl $WEBHOOK_PRODUCTION

Simply requesting the webhook, doesn't seem to trigger a git pull within Plesk, so I'm assuming that I need to add a payload.

Question: What do I need to send to the Plesk webhook in order to perform a pull?


Solution

Webhooks are done via a POST request instead of a GET request, so you will have to pass the argument -X POST to curl in order to send the request to your webhook correctly.

So your curl statement would look like this:

curl -X POST $WEBHOOK_PRODUCTION


Answered By - Sven Hakvoort
Answer Checked By - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing