Package hudson.matrix
Class MatrixProject
java.lang.Object
- All Implemented Interfaces:
ExtensionPoint,BuildableItem,BuildableItemWithBuildWrappers,Describable<TopLevelItem>,DescriptorByNameOwner,Item,ItemGroup<MatrixConfiguration>,ModelObject,PersistenceRoot,Queue.FlyweightTask,SubTask,Queue.Task,ResourceActivity,Saveable,SCMedItem,TopLevelItem,SearchableModelObject,SearchItem,AccessControlled,LazyBuildMixIn.LazyLoadingJob<MatrixProject,,MatrixBuild> Loadable,ModelObjectWithChildren,ModelObjectWithContextMenu,ParameterizedJobMixIn.ParameterizedJob<MatrixProject,,MatrixBuild> ITask,TriggeredItem,OnMaster,HasWidgets,org.kohsuke.stapler.HttpDeletable,org.kohsuke.stapler.StaplerOverridable,org.kohsuke.stapler.StaplerProxy
public class MatrixProject
extends AbstractProject<MatrixProject,MatrixBuild>
implements TopLevelItem, SCMedItem, ItemGroup<MatrixConfiguration>, Saveable, Queue.FlyweightTask, BuildableItemWithBuildWrappers
Job that allows you to run multiple different configurations
from a single setting.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class hudson.model.AbstractProject
AbstractProject.AbstractProjectDescriptor, AbstractProject.BecauseOfBuildInProgress, AbstractProject.BecauseOfDownstreamBuildInProgress, AbstractProject.BecauseOfUpstreamBuildInProgress, AbstractProject.LabelValidatorNested classes/interfaces inherited from class hudson.model.Job
Job.BuildNumberAssigner, Job.DefaultBuildNumberAssigner, Job.LastItemListener, Job.SubItemBuildsLocationImplNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface org.kohsuke.stapler.HttpDeletable
org.kohsuke.stapler.HttpDeletable.HttpDeletableDispatcherNested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MatrixProject.DescriptorImplDescriptor is instantiated as a field purely for backward compatibility.Fields inherited from class hudson.model.AbstractProject
ABORT, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, BUILD_NOW_TEXT, builds, disabled, transientActions, triggersFields inherited from class hudson.model.Job
HISTORY_ADAPTER, nextBuildNumber, properties, runIdMigratorFields inherited from class hudson.model.AbstractItem
description, displayName, name, PRONOUN, SKIP_PERMISSION_CHECK, TASK_NOUN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidalias()protected voiddoChildrenContextMenu(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) voiddoConfigDotXml(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) org.kohsuke.stapler.HttpResponseAlso delete all the workspaces of the configuration, too.Gets all active configurations.hudson.tasks.test.AggregatedTestResultActionCollection<? extends Job>getAxes()protected Class<MatrixBuild>Gets the workspace location thatMatrixConfigurationuses.Obtains the combination filter, used to trim down the size of the matrix.getDynamic(String token, org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) getItems()getJDK()Deprecated.getJDKs()Gets theJDKs where the builds will be run.Gets theLabels where the builds will be run.getPublisher(Descriptor<Publisher> descriptor) MatrixProjectis relevant with all the labels its configurations are relevant.getRootDirFor(Combination combination) Gets a root directory for the specifiedCombination.getRootDirFor(MatrixConfiguration child) Gets a root directory of the specifiedMatrixConfiguration.Deprecated.Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.getTouchStoneCombinationFilter().Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.getTouchStoneResultCondition().Deprecated.as of 1.373 System vs user difference are generalized into extension point.booleanDo we have an explicit child custom workspace setting (true)? Or just using the default value (false)?booleanbooleanDeprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.isRunSequentially().voidvoidvoidonDeleted(MatrixConfiguration item) voidvoidonRenamed(MatrixConfiguration item, String oldName, String newName) protected ObjectvoidReconfigures axes.voidsetChildCustomWorkspace(String childCustomWorkspace) voidsetCombinationFilter(String combinationFilter) Sets the combination filter.voidsetExecutionStrategy(MatrixExecutionStrategy executionStrategy) voidsetRunSequentially(boolean runSequentially) Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.setRunSequentially(boolean).voidsetSorter(MatrixConfigurationSorter sorter) Deprecated.voidsetTouchStoneCombinationFilter(String touchStoneCombinationFilter) Deprecated.voidsetTouchStoneResultCondition(Result touchStoneResultCondition) Deprecated.protected voidsubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) protected voidMethods inherited from class hudson.model.AbstractProject
_getRuns, addProperty, addToList, addTrigger, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, buildDescribable, buildDescribable, checkAbortPermission, checkout, createExecutable, disable, doBuild, doBuildWithParameters, doCheckRetryCount, doConfigSubmit, doPolling, doWs, enable, findNearest, findNearest, getActions, getAssignedLabel, getAssignedLabelString, getAuthToken, getBuild, getBuildByNumber, getBuildingDownstream, getBuildingUpstream, getBuildNowText, getBuildTriggerUpstreamProjects, getCauseOfBlockage, getCustomWorkspace, getDelay, getDownstreamProjects, getDownstreamProjectsForApi, getEnvironment, getEstimatedDurationCandidates, getFirstBuild, getHasCustomQuietPeriod, getIconColor, getLastBuild, getLastBuiltOn, getLazyBuildMixIn, getModuleRoot, getModuleRoots, getNearestBuild, getNearestOldBuild, getProminentActions, getQueueItem, getQuietPeriod, getRelationship, getResourceActivities, getResourceList, getRootProject, getSameNodeConstraint, getScm, getScmCheckoutRetryCount, getScmCheckoutStrategy, getSomeBuildWithWorkspace, getSomeWorkspace, getSubTasks, getTransitiveDownstreamProjects, getTransitiveUpstreamProjects, getTrigger, getTriggers, getUpstreamProjects, getUpstreamProjectsForApi, getWorkspace, getWorkspaceResource, hasAbortPermission, hasCustomScmCheckoutRetryCount, hasParticipant, isBuildable, isConcurrentBuild, isConfigurable, isDisabled, isInQueue, loadBuild, makeSearchIndex, newBuild, performDelete, poll, pollSCMChanges, removeFromList, removeRun, removeTrigger, resolveForCLI, save, scheduleBuild, scheduleBuild2, scheduleBuild2, scheduleBuild2, scheduleBuild2, scheduleBuild2, schedulePolling, setAssignedLabel, setAssignedNode, setBlockBuildWhenDownstreamBuilding, setBlockBuildWhenUpstreamBuilding, setConcurrentBuild, setCustomWorkspace, setDisabled, setJDK, setQuietPeriod, setScm, setScmCheckoutStrategy, submit, supportsMakeDisabled, triggersMethods inherited from class hudson.model.Job
assignBuildNumber, checkRename, createHistoryWidget, delete, doBuildStatus, doChildrenContextMenu, doDescription, doDoRename, doRssAll, doRssChangelog, doRssFailed, fastUpdateNextBuildNumber, getACL, getAllProperties, getBuildDir, getBuildDiscarder, getBuildForCLI, getBuildHealth, getBuildHealthReports, getBuilds, getBuilds, getBuildsAsMap, getBuildsByTimestamp, getBuildStatusIconClassName, getBuildStatusUrl, getBuildTimeGraph, getCharacteristicEnvVars, getDynamic, getEstimatedDuration, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getLogRotator, getNewBuilds, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getProperty, getSearchIcon, getTimeline, isBuilding, isHoldOffBuildUntilSave, isKeepDependencies, isLogUpdated, isNameEditable, movedTo, onCopiedFrom, removeProperty, removeProperty, renameTo, saveNextBuildNumber, setBuildDiscarder, setLogRotator, supportsLogRotator, updateNextBuildNumberMethods inherited from class hudson.model.AbstractItem
delete, delete, doCheckNewName, doConfigDotXml, doConfirmRename, doDoDelete, doDoDelete, doReload, doSetName, doSubmitDescription, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDisplayName, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getParent, getRelativeDisplayNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getShortUrl, getTarget, getTaskNoun, getUrl, load, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXml, writeConfigDotXml, writeReplaceMethods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getAllActions, removeAction, removeActions, replaceAction, replaceActionsMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, getACL, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods inherited from interface hudson.model.BuildableItem
scheduleBuild, scheduleBuildMethods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByNameMethods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgetsMethods inherited from interface jenkins.model.queue.ITask
hasAbortPermission, hasReadPermissionMethods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl, onCopiedFrom, saveMethods inherited from interface hudson.model.ItemGroup
allItems, allItems, allItems, getAllItems, getAllItems, getAllItems, getFullDisplayName, getFullName, getItemName, getItems, getItemsStream, getItemsStream, getUrlMethods inherited from interface jenkins.model.ParameterizedJobMixIn.ParameterizedJob
doBuild, doBuild, doBuildWithParameters, doBuildWithParameters, doCancelQueue, doDisable, doEnable, getParameterizedJobMixIn, isParameterized, makeDisabled, scheduleBuild, scheduleBuildMethods inherited from interface hudson.model.PersistenceRoot
getRootDirMethods inherited from interface hudson.model.Queue.Task
checkAbortPermission, getAffinityKey, getCauseOfBlockage, getDefaultAuthentication, getDefaultAuthentication, getDefaultAuthentication2, getDefaultAuthentication2, getFullDisplayName, getName, getSubTasks, getUrl, getWhyBlocked, isBuildBlocked, isConcurrentBuildMethods inherited from interface hudson.model.ResourceActivity
getDisplayName, getResourceListMethods inherited from interface hudson.model.SCMedItem
getScm, poll, pollSCMChangesMethods inherited from interface hudson.search.SearchableModelObject
getSearchMethods inherited from interface hudson.search.SearchItem
getSearchIcon, getSearchIndex, getSearchName, getSearchUrlMethods inherited from interface hudson.model.queue.SubTask
getAssignedLabel, getEstimatedDuration, getLastBuiltOn, getOwnerExecutable, getOwnerTask, getSameNodeConstraint
-
Field Details
-
DESCRIPTOR
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Extension public static final MatrixProject.DescriptorImpl DESCRIPTORDescriptor is instantiated as a field purely for backward compatibility. Do not do this in your code. Put @Extension on your DescriptorImpl class instead.
-
-
Constructor Details
-
MatrixProject
-
MatrixProject
-
-
Method Details
-
readResolve
-
getPronoun
- Overrides:
getPronounin classAbstractProject<MatrixProject,MatrixBuild>
-
getChildCustomWorkspace
Gets the workspace location thatMatrixConfigurationuses. Used fromMatrixRun.MatrixRunExecution.decideWorkspace.- Returns:
- never null
even when
MatrixProjectuses no custom workspace, this method still returns something like "${PARENT_WORKSPACE}/${COMBINATION}" that controls how the workspace should be laid out. The return value can be absolute or relative. If relative, it is resolved against the working directory of the overarchingMatrixBuild.
-
hasChildCustomWorkspace
public boolean hasChildCustomWorkspace()Do we have an explicit child custom workspace setting (true)? Or just using the default value (false)? -
setChildCustomWorkspace
- Throws:
IOException
-
getRelevantLabels
MatrixProjectis relevant with all the labels its configurations are relevant.- Overrides:
getRelevantLabelsin classAbstractProject<MatrixProject,MatrixBuild>
-
getSorter
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.getSorter(). This method tries to emulate the previous behavior the best it can, but will return null if the currentMatrixExecutionStrategyis not the default one.- Returns:
- can be null (to indicate that the configurations should be left to their natural order.)
-
setSorter
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.setSorter(MatrixConfigurationSorter). This method tries to emulate the previous behavior the best it can, but will fall back to no-op if the currentMatrixExecutionStrategyis not the default one.- Throws:
IOException
-
getAxes
-
setAxes
Reconfigures axes.- Throws:
IOException
-
getExecutionStrategy
-
setExecutionStrategy
- Throws:
IOException
-
isRunSequentially
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.isRunSequentially(). This method tries to emulate the previous behavior the best it can, but will return false if the currentMatrixExecutionStrategyis not the default one. -
setRunSequentially
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.setRunSequentially(boolean). This method tries to emulate the previous behavior the best it can, but will fall back to no-op if the currentMatrixExecutionStrategyis not the default one.- Throws:
IOException
-
setCombinationFilter
Sets the combination filter.- Parameters:
combinationFilter- the combinationFilter to set- Throws:
IOException
-
getCombinationFilter
Obtains the combination filter, used to trim down the size of the matrix.By default, a
MatrixConfigurationis created for every possible combination of axes exhaustively. But by specifying a Groovy expression as a combination filter, one can trim down the # of combinations built.Namely, this expression is evaluated for each axis value combination, and only when it evaluates to true, a corresponding
MatrixConfigurationwill be created and built.- Returns:
- can be null.
- Since:
- 1.279
-
getTouchStoneCombinationFilter
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.getTouchStoneCombinationFilter(). This method tries to emulate the previous behavior the best it can, but will return null if the currentMatrixExecutionStrategyis not the default one.- Returns:
- can be null (to indicate that the configurations should be left to their natural order.)
-
setTouchStoneCombinationFilter
@Deprecated public void setTouchStoneCombinationFilter(String touchStoneCombinationFilter) throws IOException Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.setTouchStoneCombinationFilter(String). This method tries to emulate the previous behavior the best it can, but will fall back to no-op if the currentMatrixExecutionStrategyis not the default one.- Throws:
IOException
-
getTouchStoneResultCondition
Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.getTouchStoneResultCondition(). This method tries to emulate the previous behavior the best it can, but will return null if the currentMatrixExecutionStrategyis not the default one.- Returns:
- can be null (to indicate that the configurations should be left to their natural order.)
-
setTouchStoneResultCondition
@Deprecated public void setTouchStoneResultCondition(Result touchStoneResultCondition) throws IOException Deprecated.as of 1.456 UseDefaultMatrixExecutionStrategyImpl.setTouchStoneResultCondition(Result). This method tries to emulate the previous behavior the best it can, but will fall back to no-op if the currentMatrixExecutionStrategyis not the default one.- Throws:
IOException
-
createTransientActions
- Overrides:
createTransientActionsin classAbstractProject<MatrixProject,MatrixBuild>
-
updateTransientActions
protected void updateTransientActions()- Overrides:
updateTransientActionsin classAbstractProject<MatrixProject,MatrixBuild>
-
getUserAxes
Deprecated.as of 1.373 System vs user difference are generalized into extension point.Gets the subset ofAxisListthat are not system axes. -
getLayouter
-
onCreatedFromScratch
public void onCreatedFromScratch()- Specified by:
onCreatedFromScratchin interfaceItem- Overrides:
onCreatedFromScratchin classAbstractProject<MatrixProject,MatrixBuild>
-
onLoad
- Specified by:
onLoadin interfaceItem- Overrides:
onLoadin classAbstractProject<MatrixProject,MatrixBuild> - Throws:
IOException
-
logRotate
- Overrides:
logRotatein classJob<MatrixProject,MatrixBuild> - Throws:
IOExceptionInterruptedException
-
getActiveConfigurations
Gets all active configurations.In contract, inactive configurations are those that are left for archival purpose and no longer built when a new
MatrixBuildis executed.During a build,
MatrixBuild.MatrixBuildExecution.getActiveConfigurations()should be used to make sure that a build is using the consistent set of active configurations from the start to the end. -
getItems
- Specified by:
getItemsin interfaceItemGroup<MatrixConfiguration>
-
getAllJobs
- Specified by:
getAllJobsin interfaceItem- Overrides:
getAllJobsin classJob<MatrixProject,MatrixBuild>
-
getUrlChildPrefix
- Specified by:
getUrlChildPrefixin interfaceItemGroup<MatrixConfiguration>
-
getItem
- Specified by:
getItemin interfaceItemGroup<MatrixConfiguration>
-
getItem
-
getRootDirFor
Gets a root directory of the specifiedMatrixConfiguration. Creates the whole directory hierarchy on-demand.- Specified by:
getRootDirForin interfaceItemGroup<MatrixConfiguration>- Parameters:
child- childMatrixConfiguration- Returns:
- Root directory for the combination
-
onRenamed
- Specified by:
onRenamedin interfaceItemGroup<MatrixConfiguration>- Throws:
IOException
-
onDeleted
- Specified by:
onDeletedin interfaceItemGroup<MatrixConfiguration>- Throws:
IOException
-
getRootDirFor
Gets a root directory for the specifiedCombination. Creates the whole directory hierarchy on-demand.- Parameters:
combination- Combination to be checked- Returns:
- Root directory for the combination
-
getJDK
Deprecated.- Overrides:
getJDKin classAbstractProject<MatrixProject,MatrixBuild> - See Also:
-
getJDKs
Gets theJDKs where the builds will be run.- Returns:
- never null but can be empty
-
getLabels
Gets theLabels where the builds will be run.- Returns:
- never null
-
getBuilders
-
getBuildersList
-
getPublishers
-
getPublishersList
- Specified by:
getPublishersListin classAbstractProject<MatrixProject,MatrixBuild>
-
getBuildWrappersList
- Specified by:
getBuildWrappersListin interfaceBuildableItemWithBuildWrappers
-
getBuildWrappers
-
getPublisher
-
getBuildClass
- Specified by:
getBuildClassin classAbstractProject<MatrixProject,MatrixBuild>
-
isFingerprintConfigured
public boolean isFingerprintConfigured()- Specified by:
isFingerprintConfiguredin classAbstractProject<MatrixProject,MatrixBuild>
-
buildDependencyGraph
- Overrides:
buildDependencyGraphin classAbstractProject<MatrixProject,MatrixBuild>
-
asProject
- Specified by:
asProjectin interfaceBuildableItemWithBuildWrappers- Specified by:
asProjectin interfaceSCMedItem
-
getDynamic
public Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) - Overrides:
getDynamicin classJob<MatrixProject,MatrixBuild>
-
submit
protected void submit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException, Descriptor.FormException - Overrides:
submitin classAbstractProject<MatrixProject,MatrixBuild> - Throws:
IOExceptionjakarta.servlet.ServletExceptionDescriptor.FormException
-
doConfigDotXml
public void doConfigDotXml(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException - Overrides:
doConfigDotXmlin classAbstractItem- Throws:
IOException
-
getAggregatedTestResultAction
public hudson.tasks.test.AggregatedTestResultAction getAggregatedTestResultAction() -
doDoWipeOutWorkspace
public org.kohsuke.stapler.HttpResponse doDoWipeOutWorkspace() throws IOException, InterruptedExceptionAlso delete all the workspaces of the configuration, too.- Overrides:
doDoWipeOutWorkspacein classAbstractProject<MatrixProject,MatrixBuild> - Throws:
IOExceptionInterruptedException
-
doChildrenContextMenu
public ModelObjectWithContextMenu.ContextMenu doChildrenContextMenu(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) throws Exception - Specified by:
doChildrenContextMenuin interfaceModelObjectWithChildren- Overrides:
doChildrenContextMenuin classJob<MatrixProject,MatrixBuild> - Throws:
Exception
-
getDescriptor
- Specified by:
getDescriptorin interfaceDescribable<TopLevelItem>- Specified by:
getDescriptorin interfaceTopLevelItem- Throws:
IllegalStateException- Jenkins is not ready
-
alias
-
DefaultMatrixExecutionStrategyImpl.getSorter().