vicenteguerra / git-deploy

Php Script for Auto-Pull in server (Using WebHook from GitLab, GitHub and Bitbucket)
641 stars 236 forks source link

Add config option for "post hook command" #2

Closed JacobDB closed 7 years ago

JacobDB commented 7 years ago

I'm trying to get a project set up that automatically pulls and runs npm i && gulp --dist. To that end, it'd be great if there was an option for command(s) to run once the pull is finished. Something like define('EXECUTE', ['array', 'of', 'sequential', 'commands']); or define('EXECUTE', 'string of commands');.

I'll try to look in doing this myself, and submit a pull request if I'm successful.

JacobDB commented 7 years ago

I'm running in to an issue with this, supposedly it's executing just fine, but my gulp task clearly isn't running. I suspect there's some error occurring, but I can't seem to figure out what. Any tips on how to go about debugging? This is my first time using exec_script().

JacobDB commented 7 years ago

Figured out my issue, I just needed to call node directly from it's path (i.e. /usr/bin/node instead of just node). I've submitted a pull request with this addition :)