Package eu.royalsloth.depbuilder.jenkins
Class DslBuild
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.model.Run<P,R>
-
- hudson.model.AbstractBuild<P,B>
-
- hudson.model.Build<DslProject,DslBuild>
-
- eu.royalsloth.depbuilder.jenkins.DslBuild
-
- All Implemented Interfaces:
ExtensionPoint
,DescriptorByNameOwner
,ModelObject
,PersistenceRoot
,Queue.Executable
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,Comparable<DslBuild>
,Runnable
,LazyBuildMixIn.LazyLoadingRun<DslProject,DslBuild>
,ModelObjectWithContextMenu
,RunWithSCM<DslProject,DslBuild>
,OnMaster
,org.kohsuke.stapler.StaplerProxy
public class DslBuild extends Build<DslProject,DslBuild>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
DslBuild.BuildExecution
Implementation copied from freestyle project.-
Nested classes/interfaces inherited from class hudson.model.Build
Build.RunnerImpl
-
Nested classes/interfaces inherited from class hudson.model.AbstractBuild
AbstractBuild.AbstractBuildExecution, AbstractBuild.AbstractRunner, AbstractBuild.DependencyChange
-
Nested classes/interfaces inherited from class hudson.model.Run
Run.Artifact, Run.ArtifactList, Run.KeepLogBuildBadge, Run.RedirectUp, Run.RunExecution, Run.Runner, Run.RunnerAbortedException, Run.StatusSummarizer, Run.Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem
-
-
Field Summary
-
Fields inherited from class hudson.model.AbstractBuild
buildEnvironments
-
Fields inherited from class hudson.model.Run
ARTIFACTS, charset, DELETE, description, duration, FEED_ADAPTER, FEED_ADAPTER_LATEST, LIST_CUTOFF, nextBuild, number, ORDER_BY_DATE, PERMISSIONS, previousBuild, project, QUEUE_ID_UNKNOWN, result, SKIP_PERMISSION_CHECK, timestamp, TREE_CUTOFF, UPDATE, XSTREAM, XSTREAM2
-
-
Constructor Summary
Constructors Constructor Description DslBuild(DslProject project)
DslBuild(DslProject project, File buildDir)
DslBuild(DslProject project, Calendar timestamp)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
convertBuildResult(Result buildResult)
void
doStartPartialBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String job)
Endpoint that allows the user to trigger a partial build of the pipeline.static String
durationToString(long milliseconds)
ProjectGraph
getBuildGraph()
Get the structure of the build pipeline (how are jobs connected).net.sf.json.JSONObject
getDslBuild()
Endpoint to get the structure of the build graph.String
getPipeline()
net.sf.json.JSONObject
getStatus()
Endpoint that is called by the frontend when we want to get the current build status report.boolean
isFinished()
void
run()
static Scheduler
schedulerFactory(PrintStream logger, BuildLayers layers, SchedulerSettings settings, Instant startTime, List<String> partialBuilds)
static ParsedBuild
verifyPipeline(String projectName, String pipeline)
Parse the DslProject pipeline and verify the build settings.-
Methods inherited from class hudson.model.Build
createRunner
-
Methods inherited from class hudson.model.AbstractBuild
addAction, calculateCulprits, createReference, doStop, doStop, dropLinks, due, getAggregatedTestResultAction, getBuildVariableResolver, getBuildVariables, getBuiltOn, getBuiltOnStr, getChangeSet, getChangeSets, getCulpritIds, getCulprits, getDependencyChanges, getDownstreamBuilds, getDownstreamBuilds, getDownstreamRelationship, getEnvironment, getEnvironments, getHudsonVersion, getModuleRoot, getModuleRoots, getNextBuild, getPersistentActions, getPreviousBuild, getProject, getRootBuild, getRunMixIn, getSensitiveBuildVariables, getTestResultAction, getTransitiveUpstreamBuilds, getUpstreamBuilds, getUpstreamRelationship, getUpstreamRelationshipBuild, getUpUrl, getWhyKeepLog, getWorkspace, hasChangeSetComputed, setBuiltOnStr, setWorkspace, shouldCalculateCulprits
-
Methods inherited from class hudson.model.Run
_this, canToggleLogKeep, compareTo, delete, deleteArtifacts, doArtifact, doBuildNumber, doBuildStatus, doBuildTimestamp, doConfigSubmit, doConsoleText, doDoDelete, doProgressiveLog, doSubmitDescription, doToggleLogKeep, execute, fromExternalizableId, getAbsoluteUrl, getACL, getApi, getArtifactManager, getArtifacts, getArtifactsDir, getArtifactsUpTo, getBadgeActions, getBuildFingerprints, getBuildsOverThreshold, getBuildStatusIconClassName, getBuildStatusSummary, getBuildStatusUrl, getCause, getCauses, getCharacteristicEnvVars, getCharset, getDescription, getDisplayName, getDuration, getDurationString, getDynamic, getEnvironment, getEnvVars, getEstimatedDuration, getExecutor, getExternalizableId, getFullDisplayName, getHasArtifacts, getIconColor, getId, getLog, getLog, getLogFile, getLogInputStream, getLogReader, getLogText, getNumber, getOneOffExecutor, getParent, getPreviousBuildInProgress, getPreviousBuildsOverThreshold, getPreviousBuiltBuild, getPreviousCompletedBuild, getPreviousFailedBuild, getPreviousNotFailedBuild, getPreviousSuccessfulBuild, getQueueId, getResult, getRootDir, getSearchUrl, getStartTimeInMillis, getTarget, getTime, getTimeInMillis, getTimestamp, getTimestampString, getTimestampString2, getTransientActions, getTruncatedDescription, getUrl, hasCustomDisplayName, hasntStartedYet, isBuilding, isInProgress, isKeepLog, isLogUpdated, keepLog, keepLog, makeSearchIndex, onEndBuilding, onLoad, onStartBuilding, pickArtifactManager, reload, run, save, setDescription, setDisplayName, setQueueId, setResult, submit, toString, updateSymlinks, writeLogTo, writeWholeLogTo
-
Methods inherited from class hudson.model.Actionable
addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, removeAction, removeActions, replaceAction, replaceActions
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, requirePOST, sendError, sendError, sendError, sendError, sendError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission
-
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
-
Methods inherited from interface hudson.model.Queue.Executable
getEstimatedDuration, getParent, toString
-
Methods inherited from interface jenkins.scm.RunWithSCM
hasParticipant
-
-
-
-
Constructor Detail
-
DslBuild
public DslBuild(DslProject project) throws IOException
- Throws:
IOException
-
DslBuild
public DslBuild(DslProject project, Calendar timestamp)
-
DslBuild
public DslBuild(DslProject project, File buildDir) throws IOException
- Throws:
IOException
-
-
Method Detail
-
durationToString
public static String durationToString(long milliseconds)
-
isFinished
public boolean isFinished()
-
getPipeline
@Exported @CheckForNull public String getPipeline()
-
getStatus
@Exported public net.sf.json.JSONObject getStatus()
Endpoint that is called by the frontend when we want to get the current build status report.
-
getDslBuild
@Exported public net.sf.json.JSONObject getDslBuild()
Endpoint to get the structure of the build graph. All graph nodes are returned (even the ones that are waiting in the build queue). This endpoint is accessible under specific job build: /jenkins/job// -
doStartPartialBuild
@POST public void doStartPartialBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter String job) throws IOException
Endpoint that allows the user to trigger a partial build of the pipeline. This action is usually triggered by clicking on the play icon of the node in pipeline frontend.- Parameters:
job
- name of the job that should be built- Throws:
IOException
-
getBuildGraph
public ProjectGraph getBuildGraph()
Get the structure of the build pipeline (how are jobs connected).
-
verifyPipeline
public static ParsedBuild verifyPipeline(String projectName, String pipeline) throws ParseException, BuildCycleException
Parse the DslProject pipeline and verify the build settings.- Parameters:
projectName
- - name of the project for which the pipeline is verifiedpipeline
- - pipeline DSL that will be validated- Returns:
- parsed pipeline into build nodes
- Throws:
ParseException
- in case of any parse error or setting that does not existBuildCycleException
-
schedulerFactory
public static Scheduler schedulerFactory(PrintStream logger, BuildLayers layers, SchedulerSettings settings, Instant startTime, List<String> partialBuilds)
-
run
public void run()
- Specified by:
run
in interfaceQueue.Executable
- Specified by:
run
in interfaceRunnable
- Overrides:
run
in classBuild<DslProject,DslBuild>
-
-
-