Download the PHP package forsaken-threads/get-hooked without Composer
On this page you can find all versions of the php package forsaken-threads/get-hooked. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package get-hooked
Get Hooked
A simple-ish GitLab webhook handler
This is something I put together to auto-deploy some static sites whenever I pushed to a private GitLab repo. It's extensible and has some neat features but is really just a quick hack.
One part handler, one part queue
Basically the webhook handler takes GitLab hooks and stores them in a local Queue. Then a locally run Queue Worker will pull them off the Queue and you can respond to them at your leisure. For example, if you get a flurry of pushes that need deployment to production
, you probably don't want to pull down every change as it happens. You can queue up that deployment and then do it once rather than responding to every trigger.
Of course, you can also respond to hooks in real-time, or do a combination of both.
Very basic setup
Installation
composer require forsaken-threads/get-hooked
The Webhook Handler
Put this somewhere public that GitLab can hit.
Super easy, right? This will respond to all push
events from GitLab. What if you wanted something a little more specific? There's no need to deploy to master
when there's a push to a different branch. Event Receivers can be set fluently. Here are some of the options:
Now the deployment will only occur when Keith Freeman
pushes to the master
branch on the keithfreeman/forsaken-threads-website
repository. All other events will be dropped. Unless, of course, they are accepted by different Event Receivers.
The Queue Worker
Put this somewhere logical and set up a cron
job to run it as frequently as you like.
Also super easy, right? This will pull commands off the queue and work them.
Is that all?
What else can it do?
At the moment, not much. In theory, one could add Event Receivers to respond to other event types. I am totally for doing that if somebody really wants one. The only other receiver I have written is DeployOnPush
in the example above. If you want a tad more control over, say, a GitLab => Slack integration, you could totally write a handful of receivers and do whatever you wanted. If they have broad enough appeal, I could list them here, or even include them in the repo. That's what open source is all about, anyway, isn't it? Sharing solutions.
For more info
If you want to take a deeper dive, you can check out Event Receivers in depth here.
All versions of get-hooked with dependencies
evenement/evenement Version ^2.0
adammbalogh/key-value-store Version ^0.5.3
adammbalogh/key-value-store-file Version ^0.5.3