Class BuildWithEiffelLinksAction<JobT extends Job<JobT,RunT> & ParameterizedJobMixIn.ParameterizedJob<JobT,RunT>,RunT extends Run<JobT,RunT> & Queue.Executable>
java.lang.Object
com.axis.jenkins.plugins.eiffel.eiffelbroadcaster.BuildWithEiffelLinksAction<JobT,RunT>
- All Implemented Interfaces:
Action
,ModelObject
public class BuildWithEiffelLinksAction<JobT extends Job<JobT,RunT> & ParameterizedJobMixIn.ParameterizedJob<JobT,RunT>,RunT extends Run<JobT,RunT> & Queue.Executable>
extends Object
implements Action
An
Action
that attaches an additional API endpoint to jobs for starting a build with one
or more Eiffel links. The endpoint is $JOB_URL/eiffel/build and should behave as the regular
$JOB_URL/build endpoint, i.e. you can supply parameters by posting a form with a JSON string.
Additionally, it requires a (possibly empty) list of Eiffel links. Example (payload lacking URL
encoding to improve readability):
POST $JOB_URL/eiffel/build Content-Type: application/x-www-form-urlencoded json={"eiffellinks": [{"target": "662b3813-bef4-4588-bf75-ffaead24a6d5", "type": "CAUSE"}], "parameter": [{"name": "PARAM_NAME", "value": "param value"}]}The Eiffel links, if any, will be passed to the build as an
EiffelCause
cause.
That cause will be used when piecing together the
EiffelActivityTriggeredEvent
which gets captured in the Run
's EiffelActivityAction
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
doBuild
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, TimeDuration delay) Responds to a /build request by parsing the posted form and transforming the Eiffel links and (optionally) build parameters into actions that'll get passed to the new build.getCallerCause
(org.kohsuke.stapler.StaplerRequest req) Returns aCause
that indicates the caller that requested the build (either aCause.RemoteCause
or aCause.UserIdCause
).
-
Field Details
-
FORM_PARAM_EIFFELLINKS
The form parameter that holds the Eiffel links.- See Also:
-
FORM_PARAM_PARAMETERS
The form parameter that holds the build parameters.- See Also:
-
URL_SUFFIX
The immediate suffix to the URL of theJob
, i.e. the URLs served by this action will have the form $JOB_URL/$URL_SUFFIX.- See Also:
-
-
Constructor Details
-
BuildWithEiffelLinksAction
-
-
Method Details
-
doBuild
public void doBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException Responds to a /build request by parsing the posted form and transforming the Eiffel links and (optionally) build parameters into actions that'll get passed to the new build.- Throws:
IOException
-
getCallerCause
Returns aCause
that indicates the caller that requested the build (either aCause.RemoteCause
or aCause.UserIdCause
).The implementation was copied from
ParameterizedJobMixIn.getBuildCause(ParameterizedJobMixIn.ParameterizedJob, StaplerRequest)
and only slightly modified. -
getIconFileName
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getUrlName
- Specified by:
getUrlName
in interfaceAction
-