-
Notifications
You must be signed in to change notification settings - Fork 11
Connectors
By default, only GitHub WebHooks, BitBucket WebHooks and HTTP connectors are supported, but custom ones can be added.
-
Create a plug-in which depends on the
seed
plugin. -
Create a class which extends the
AbstractEndPoint
class and implement theUnprotectedRootAction
interface -
Implement the
getUrlName()
and theSeedEvent 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 theSeedEventType
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 aSeedChannel
, is used for tracing purposes and is generally a constant for your connector, like:
SeedChannel.of("my-connector", "My connector to pilot my seeds");