-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow web-hooks to be configured to fire on test or deploy #6
base: master
Are you sure you want to change the base?
Conversation
This fires all webhooks for both events. Could you add something to the config page to allow the user to specify whether a hook should fire on test or on deploy? |
I'll take a look at the UI code and see what I can do. Should I add a hook for each phase (env, prep, test, deploy, cleanup) and then a check box grid for each web-hook? |
Let's go for simple first - just test and deploy. If people find the need On Sat, Aug 9, 2014 at 7:25 PM, ProZachJ [email protected] wrote:
|
Ok try this out, as far as I've tested manually everything is good to go. Oh also...we wrote a hubot script to listen for the web-hook and post it into any chatroom that your specify in the callback URI. |
Awesome :) Looks like there are some merge conflicts --- could you merge with current master? |
Done |
context.comment('Failed to prepare webhook payload: ' + e.message); | ||
} | ||
} | ||
else if(hook.trigger === 'deploy'){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't belong in onTested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is there to register the deploy listeners after the tests pass. If you register the deploy listener when the test listeners are registered and tests fail you will orphan the listener and it will fire two web-hooks on the next deploy. I guess I could check the payload to see if tests failed to remove the listeners but this seemed cleaner.
I'll see if I can think of a way to refactor.
Refactordeploy
function onTested(id, data) { | ||
io.removeListener('job.status.tested', onTested) | ||
io.on('job.status.tested', onTested) | ||
if(job.type === 'TEST_AND_DEPLOY'){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only register the deploy listener if the job is going to deploy.
Comments added |
Any chance this can get merged? I'm having to pull strider from my fork when I want to deploy. |
@ProZachJ If you could rebase and squash your commits, I'd be willing to merge. |
Will do.
|
Ping 👍 |
Wow I totally forgot to do this after I got it working on my server. I'll On Jun 2, 2016 7:41 AM, "Ilya Radchenko" [email protected] wrote:
|
Fixes #5
I figured out why my web-hook wasn't firing after deploy. The worker was only listening for
job.status.tested
. So I added a listener forjob.status.deployed
. Instead of reusingtest_exitcode
I add a new property to to the payloaddeploy_exitcode
. I also changed the output to say which webhook listener is being fired.I tested this on my fully updated strider. However I had to remove strider-sauce to work around #4