• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Git webhook and branch

deleb

New Pleskian
Hi all :)

I read through the webhook documentation but there's one question I couldn't find the answer to.

Github triggers the webhooks on commits to any branch but I am only interested for Plesk to auto deploy updates from the branch I selected for the domain. Will Plesk check if the webhook was triggered by a commit on the selected branch or will it deploy everytime the webhook is triggered regardless of the branch?
 
So I've been doing some testing today...

I set up a domain with git on Plesk, enabled automatic deploys, set up a post deploy script, selected the "test" branch and added the specified webhook on GitHub.

After the set up, the "pull updates" button works like a charm, gets the repo to the local plesk repo, deploys the files and executes my script.

Then I try doing a commit to the "test" branch on GitHub, GitHub runs the webhook and Plesk pull the changes from "test" to the local repo, deploys the files and executes my script. Nice!

But then comes the interesting part, if I do a commit to the "dev" branch on GitHub, GitHub runs the webhook and Plesk tries to pull from "test", then (may or may not re do the deploy) and finally executes my script.

The way it seems to be set up, webhooks are not really an option for automatic deployments. Maybe only if you don't need a post script?

Does anyone use the webhooks with an auto deploy setting? Any suggestions to avoid my script being executed when there are no changes to the selected branch?

I believe it should be a good addition for Plesk to verify the webhook to ignore any changes on branches different from the one used to deploy from on the local repository.
 
Back
Top