We would like to trigger builds by messages sent to an Amazon SNS topic, 
which be relayed to a subscribing SQS queue.
The closest plug-in that I have found which does something similar is the 
github-sqs-plugin <https://github.com/jenkinsci/github-sqs-plugin>. 

As-is however, the plugin has some limitations that would need to be sorted 
out before it might meet our needs:
* (minor, fixed) Publishing via SNS instead of directly to SQS wasn't 
working. This turned out to be a bug (JENKINS-19337) 
<https://issues.jenkins-ci.org/browse/JENKINS-19337> for which we just 
submitted a PR upstream 
<https://github.com/jenkinsci/github-sqs-plugin/pull/5> to fix.
* (major, would require development) The plug-in as written expects the 
format of the json for the payload to be such as would be sent directly 
from a GitHub webhook. It then pokes any job configured to both use the 
plugin and also has that particular GitHub repo defined as a Git SCM. This 
won't meet our needs because we would like to include metadata in the 
message such as which hash to build. Also I'd prefer that instead of all 
jobs, you could specify which exact job or jobs to trigger (maybe via 
regex?), and parameters to pass to those jobs.
* (unknown) I'm not sure exactly but I suspect that this will not trigger 
workflow jobs. I could be wrong.

I wanted to reach out here before undertaking new feature development.

The direction I would be heading, and am soliciting feedback on the 
approach, would be to add a global configuration option (checkbox) for the 
plugin named something like "Trigger builds via metadata in queue message."
* In the (default) case of it being unchecked, the plug-in will operate as 
it does now.
* If checked, the plugin will parse the json of the message for an object 
named something like "ci-data" which will in turn contain the regex of 
job(s) to trigger and the parameter keys and values to pass. Instead of 
poking the jobs to wake up and decide themselves whether or not to build, 
it will use ParameterizedJobMixIn's scheduleBuild2 
<http://javadoc.jenkins-ci.org/jenkins/model/ParameterizedJobMixIn.html#scheduleBuild2(hudson.model.Job,
 
int, hudson.model.Action...)> method with a parameters action 
<http://javadoc.jenkins-ci.org/hudson/model/ParametersAction.html> in which 
you pass the parameters and their values.

Couple questions:
* Does this seem sane? Any feedback or thoughts on this approach?
* Aaron Walker are you still on this list? Especially interested in your 
thoughts as the original writer/maintainer.

Thanks.

-- JZ

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/d84465db-83d0-43da-8a88-4c153a79f376%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to