Class PlatformStepTask

java.lang.Object
fr.paris.lutece.plugins.releaser.service.platform.PlatformStepTask
All Implemented Interfaces:
Runnable

public class PlatformStepTask extends Object implements Runnable
Background execution of a platform step : triggers the Jenkins job with the plan, follows the build and records its result on the step.
  • Field Details

    • PARAM_RELEASE_TARGET

      public static final String PARAM_RELEASE_TARGET
      Parameters of the existing lutece-platform release pipeline
      See Also:
    • PARAM_LUTECE_MAJOR

      public static final String PARAM_LUTECE_MAJOR
      See Also:
    • PARAM_ALLOW_SNAPSHOT_DEPENDENCIES

      public static final String PARAM_ALLOW_SNAPSHOT_DEPENDENCIES
      See Also:
    • EDITABLE_PARAMETERS

      public static final List<String> 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

      public static final String 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 id
      nStepNumber - the step number
      plan - the plan to send
      mapCredentialParameters - the credentials of the person releasing, as build parameters (see buildCredentialParameters(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 id
      nStepNumber - the step number
      plan - the plan sent with the build, read back from the step
      strBuildUrl - the URL of the build to follow
      nBuildNumber - 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

      public static Map<String,String> buildCredentialParameters(ReleaserUser user)
      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()
      Specified by:
      run in interface Runnable