Skip to content
Damien Coraboeuf edited this page Jun 6, 2016 · 3 revisions

By default, only GitHub WebHooks, BitBucket WebHooks and HTTP connectors are supported, but custom ones can be added.

  1. Create a plug-in which depends on the seed plugin.

  2. Create a class which extends the AbstractEndPoint class and implement the UnprotectedRootAction interface

  3. Implement the getUrlName() and the SeedEvent extractEvent(StaplerRequest req) methods.

The getUrlName() returns the URL path after the Jenkins root. For example, if your connector returns my-connector-api and if your Jenkins instance runs at http://localhost:8080/jenkins, your end point will be available at http://localhost:8080/jenkins/my-connector-api.

The extractEvent receives the incoming request, always a POST, and must extract information in order to create a SeedEvent which will be used by the Seed plugin to carry out operations like creating a branch, starting a pipeline, etc.

A SeedEvent is created using:

new SeedEvent(
       project,
       branch,
       eventType,
       channel
)

where:

  • project is the ID of the project as being configured in the settings
  • branch is the branch where the event occurs
  • eventType is one of the events defined by the SeedEventType enumeration:
    • TEST - ping event, only logging
    • CREATION - creation of a branch
    • DELETION - deletion of a branch
    • SEED - change in the seed definition - the branch pipeline will be regenerated
    • COMMIT - commit on the branch, the pipeline must be fired
    • see the trigger documentation for more information about the different types of events
  • channel is a SeedChannel, is used for tracing purposes and is generally a constant for your connector, like:
SeedChannel.of("my-connector", "My connector to pilot my seeds");

See also

Clone this wiki locally