Question

So I was searching and can't find how to set up git hook with wordpress

I added a deploy.php to my public_html directory where is my wordpress blog!

so when I commit to git stuff, something server doesn't pull it and when I type www.example/depoly.php

it shows error 404 page not found its there any way to make wordpress avoid that file and just execute content:<pre> <?php system("git pull");?> </pre>

ANY HELP THANKS:)

Était-ce utile?

La solution

Use post-receive hooks to trigger automated deployment. The post-receive hook will automatically will automatically be triggered by Git.

As an example - In hooks/post-receive put the following

GIT_REPO=$HOME/myrepo.git
PUBLIC_WWW=/var/www/myrepo

cp $GIT_REPO $PUBLIC_WWW

If you require further detailed documentation - http://git-scm.com/book/en/Customizing-Git-Git-Hooks

An example of automated deployment on website - http://www.sitepoint.com/one-click-app-deployment-server-side-git-hooks/

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top