use of org.jenkins.plugins.audit2db.internal.model.BuildDetailsImpl in project selenium_java by sergueik.
the class BuildDetailsResolver method resolveBuildDetails.
/**
* This method creates a BuildDetails object with infomation from the
* jobs run context.
*
* <b>Note:</b> The <code>endDate</code>, <code>duration</code>, and <code>result</code>
* properties are <b>not</b> set, since that information is not accessiable from a pipeline
* job without a {@link CpsFlowExecution}, which we may not have at call time.
*
* @param run This pipeline's run context
* @param computer The node this job is currently running on. Since this is a pipeline job, it may be inconsistent.
* @return The populated BuildDetails.
*/
public static BuildDetails resolveBuildDetails(Run<?, ?> run, Computer computer) {
LOGGER.fine("resolving BuildDetails");
BuildDetailsImpl details = new BuildDetailsImpl();
LOGGER.fine("computer: " + computer);
LOGGER.fine("run: " + run);
LOGGER.fine("start time: " + run.getStartTimeInMillis());
details.setFullName(run.getFullDisplayName());
details.setId(run.getId());
details.setName(run.getDisplayName());
details.setStartDate(new Date(run.getStartTimeInMillis()));
LOGGER.finer("base BuildDetails: " + details);
try {
addParametersFromContext(details, run);
addUserInfoFromContext(details, run);
addBuildNodeFromContext(details, run, computer);
} catch (Exception e) {
// IOException, InterruptedException
throw new Audit2DbPipelineStepException(e);
}
return details;
}
Aggregations