Class PlatformStepTask
java.lang.Object
fr.paris.lutece.plugins.releaser.service.platform.PlatformStepTask
- All Implemented Interfaces:
Runnable
Background execution of a platform step : triggers the Jenkins job with the plan, follows the build and records its result on the step.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classVerification of the aggregate in verify-report.json : a resource verification carrying its own coordinates.static classContent of verify-report.json : the verification of each component, then of the aggregate. -
Field Summary
FieldsModifier and TypeFieldDescriptionParameters of the lutece-platform pipeline that can be changed on the screen of the last step ; the others come from the campaignstatic final Stringstatic final Stringstatic final StringParameters of the existing lutece-platform release pipelinestatic final String -
Constructor Summary
ConstructorsConstructorDescriptionPlatformStepTask(int nIdPlatformRelease, int nStepNumber, PlatformReleasePlan plan, String strBuildUrl, int nBuildNumber) Constructor of a task that follows an already triggered build again, after a restart of the webapp or a lost connection : nothing is triggered, the result of the known build is awaited and recorded as usual.PlatformStepTask(int nIdPlatformRelease, int nStepNumber, PlatformReleasePlan plan, Map<String, String> mapCredentialParameters) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionBuilds the build parameters carrying the credentials of the person releasing : login and token of GitHub and GitLab when the user gave them.static booleanisFollowed(int nIdStep) Whether a task of this webapp is following the build of a step right now, or waits for a thread to do so.voidrun()voidsubmit(int nIdStep) Hands the task over to the release thread pool.
-
Field Details
-
PARAM_RELEASE_TARGET
Parameters of the existing lutece-platform release pipeline- See Also:
-
PARAM_LUTECE_MAJOR
- See Also:
-
PARAM_ALLOW_SNAPSHOT_DEPENDENCIES
- See Also:
-
EDITABLE_PARAMETERS
Parameters of the lutece-platform pipeline that can be changed on the screen of the last step ; the others come from the campaign -
RELEASE_TARGET_ALL
- See Also:
-
-
Constructor Details
-
PlatformStepTask
public PlatformStepTask(int nIdPlatformRelease, int nStepNumber, PlatformReleasePlan plan, Map<String, String> mapCredentialParameters) Constructor.- Parameters:
nIdPlatformRelease- the campaign idnStepNumber- the step numberplan- the plan to sendmapCredentialParameters- the credentials of the person releasing, as build parameters (seebuildCredentialParameters(ReleaserUser))
-
PlatformStepTask
public PlatformStepTask(int nIdPlatformRelease, int nStepNumber, PlatformReleasePlan plan, String strBuildUrl, int nBuildNumber) Constructor of a task that follows an already triggered build again, after a restart of the webapp or a lost connection : nothing is triggered, the result of the known build is awaited and recorded as usual.- Parameters:
nIdPlatformRelease- the campaign idnStepNumber- the step numberplan- the plan sent with the build, read back from the stepstrBuildUrl- the URL of the build to follownBuildNumber- its number
-
-
Method Details
-
submit
public void submit(int nIdStep) Hands the task over to the release thread pool. The task counts as following the step as soon as it is queued, so that a step whose task waits for a free thread can neither be rearmed nor launched again.- Parameters:
nIdStep- the step id
-
isFollowed
public static boolean isFollowed(int nIdStep) Whether a task of this webapp is following the build of a step right now, or waits for a thread to do so. False after a restart : the step must be rearmed.- Parameters:
nIdStep- the step id- Returns:
- true when followed
-
buildCredentialParameters
Builds the build parameters carrying the credentials of the person releasing : login and token of GitHub and GitLab when the user gave them. The pipelines clone and push with them, so that nothing is pushed beyond the rights of that person. They are sent with the plan but never stored with it nor logged.- Parameters:
user- the releaser user, null when not authenticated- Returns:
- the parameters, empty when the user gave no credentials
-
run
public void run()
-