Package hudson.matrix
Class MatrixProject
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.model.AbstractItem
-
- hudson.model.Job<P,R>
-
- hudson.model.AbstractProject<MatrixProject,MatrixBuild>
-
- hudson.matrix.MatrixProject
-
- 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>
,ModelObjectWithChildren
,ModelObjectWithContextMenu
,ParameterizedJobMixIn.ParameterizedJob<MatrixProject,MatrixBuild>
,TriggeredItem
,OnMaster
,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 Classes Modifier and Type Class Description static class
MatrixProject.DescriptorImpl
-
Nested classes/interfaces inherited from class hudson.model.AbstractProject
AbstractProject.AbstractProjectDescriptor, AbstractProject.BecauseOfBuildInProgress, AbstractProject.BecauseOfDownstreamBuildInProgress, AbstractProject.BecauseOfUpstreamBuildInProgress, AbstractProject.LabelValidator
-
Nested classes/interfaces inherited from class hudson.model.Job
Job.LastItemListener, Job.SubItemBuildsLocationImpl
-
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, ModelObjectWithContextMenu.MenuItemType
-
-
Field Summary
Fields Modifier and Type Field Description static MatrixProject.DescriptorImpl
DESCRIPTOR
Descriptor 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, triggers
-
Fields inherited from class hudson.model.Job
HISTORY_ADAPTER, nextBuildNumber, properties, runIdMigrator
-
Fields inherited from class hudson.model.AbstractItem
description, displayName, name, PRONOUN, SKIP_PERMISSION_CHECK, TASK_NOUN
-
-
Constructor Summary
Constructors Constructor Description MatrixProject(ItemGroup parent, String name)
MatrixProject(String name)
-
Method Summary
-
Methods inherited from class hudson.model.AbstractProject
_getRuns, addProperty, addToList, addTrigger, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, buildDescribable, buildDescribable, checkAbortPermission, checkout, createExecutable, createHistoryWidget, 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, 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, supportsMakeDisabled, triggers
-
Methods inherited from class hudson.model.Job
assignBuildNumber, checkRename, delete, doBuildStatus, doDescription, doDoRename, doRssAll, doRssChangelog, doRssFailed, getACL, getAllProperties, getBuildDir, getBuildDiscarder, getBuildForCLI, getBuildHealth, getBuildHealthReports, getBuilds, getBuilds, getBuildsAsMap, getBuildsByTimestamp, getBuildStatusIconClassName, getBuildStatusUrl, getBuildTimeGraph, getCharacteristicEnvVars, getEstimatedDuration, getEstimatedDurationCandidates, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getLogRotator, getNewBuilds, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getProperty, getTimeline, getWidgets, isBuilding, isHoldOffBuildUntilSave, isKeepDependencies, isLogUpdated, isNameEditable, movedTo, onCopiedFrom, removeProperty, removeProperty, renameTo, saveNextBuildNumber, setBuildDiscarder, setLogRotator, supportsLogRotator, updateNextBuildNumber
-
Methods inherited from class hudson.model.AbstractItem
delete, doCheckNewName, doConfirmRename, doDoDelete, doReload, doSetName, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDisplayName, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getParent, getRelativeDisplayNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getShortUrl, getTarget, getTaskNoun, getUrl, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXml, writeConfigDotXml, writeReplace
-
Methods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getAllActions, removeAction, removeActions, replaceAction, replaceActions
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, 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, getACL, hasAnyPermission, hasPermission, hasPermission, hasPermission2
-
Methods inherited from interface hudson.model.BuildableItem
scheduleBuild, scheduleBuild
-
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
-
Methods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl, onCopiedFrom, save
-
Methods inherited from interface hudson.model.ItemGroup
allItems, allItems, allItems, getAllItems, getAllItems, getAllItems, getFullDisplayName, getFullName, getItems, getItemsStream, getItemsStream, getUrl
-
Methods inherited from interface jenkins.model.ParameterizedJobMixIn.ParameterizedJob
doBuild, doBuildWithParameters, doCancelQueue, doDisable, doEnable, getParameterizedJobMixIn, isParameterized, makeDisabled, scheduleBuild, scheduleBuild
-
Methods inherited from interface hudson.model.PersistenceRoot
getRootDir
-
Methods inherited from interface hudson.model.Queue.Task
checkAbortPermission, getAffinityKey, getCauseOfBlockage, getDefaultAuthentication, getDefaultAuthentication, getDefaultAuthentication2, getDefaultAuthentication2, getFullDisplayName, getName, getSubTasks, getUrl, getWhyBlocked, hasAbortPermission, isBuildBlocked, isConcurrentBuild
-
Methods inherited from interface hudson.model.ResourceActivity
getDisplayName, getResourceList
-
Methods inherited from interface hudson.model.SCMedItem
getScm, poll, pollSCMChanges
-
Methods inherited from interface hudson.search.SearchableModelObject
getSearch
-
Methods inherited from interface hudson.search.SearchItem
getSearchIndex, getSearchName, getSearchUrl
-
Methods inherited from interface hudson.model.queue.SubTask
getAssignedLabel, getEstimatedDuration, getLastBuiltOn, getOwnerExecutable, getOwnerTask, getSameNodeConstraint
-
-
-
-
Field Detail
-
DESCRIPTOR
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Extension public static final MatrixProject.DescriptorImpl DESCRIPTOR
Descriptor is instantiated as a field purely for backward compatibility. Do not do this in your code. Put @Extension on your DescriptorImpl class instead.
-
-
Method Detail
-
readResolve
protected Object readResolve()
-
getPronoun
public String getPronoun()
- Overrides:
getPronoun
in classAbstractProject<MatrixProject,MatrixBuild>
-
getChildCustomWorkspace
public String getChildCustomWorkspace()
Gets the workspace location thatMatrixConfiguration
uses. Used fromMatrixRun.MatrixRunExecution.decideWorkspace
.- Returns:
- never null
even when
MatrixProject
uses 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
public void setChildCustomWorkspace(String childCustomWorkspace) throws IOException
- Throws:
IOException
-
getRelevantLabels
public Set<Label> getRelevantLabels()
MatrixProject
is relevant with all the labels its configurations are relevant.- Overrides:
getRelevantLabels
in classAbstractProject<MatrixProject,MatrixBuild>
-
getSorter
@Deprecated public MatrixConfigurationSorter 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 currentMatrixExecutionStrategy
is not the default one.- Returns:
- can be null (to indicate that the configurations should be left to their natural order.)
-
setSorter
@Deprecated public void setSorter(MatrixConfigurationSorter sorter) throws IOException
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 currentMatrixExecutionStrategy
is not the default one.- Throws:
IOException
-
getAxes
public AxisList getAxes()
-
setAxes
public void setAxes(AxisList axes) throws IOException
Reconfigures axes.- Throws:
IOException
-
getExecutionStrategy
public MatrixExecutionStrategy getExecutionStrategy()
-
setExecutionStrategy
public void setExecutionStrategy(MatrixExecutionStrategy executionStrategy) throws IOException
- Throws:
IOException
-
isRunSequentially
@Deprecated public boolean 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 currentMatrixExecutionStrategy
is not the default one.
-
setRunSequentially
@Deprecated public void setRunSequentially(boolean runSequentially) throws IOException
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 currentMatrixExecutionStrategy
is not the default one.- Throws:
IOException
-
setCombinationFilter
public void setCombinationFilter(String combinationFilter) throws IOException
Sets the combination filter.- Parameters:
combinationFilter
- the combinationFilter to set- Throws:
IOException
-
getCombinationFilter
public String getCombinationFilter()
Obtains the combination filter, used to trim down the size of the matrix.By default, a
MatrixConfiguration
is 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
MatrixConfiguration
will be created and built.- Returns:
- can be null.
- Since:
- 1.279
-
getTouchStoneCombinationFilter
@Deprecated public String 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 currentMatrixExecutionStrategy
is 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 currentMatrixExecutionStrategy
is not the default one.- Throws:
IOException
-
getTouchStoneResultCondition
@Deprecated public Result 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 currentMatrixExecutionStrategy
is 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 currentMatrixExecutionStrategy
is not the default one.- Throws:
IOException
-
createTransientActions
protected List<Action> createTransientActions()
- Overrides:
createTransientActions
in classAbstractProject<MatrixProject,MatrixBuild>
-
updateTransientActions
protected void updateTransientActions()
- Overrides:
updateTransientActions
in classAbstractProject<MatrixProject,MatrixBuild>
-
getUserAxes
@Deprecated public List<Axis> getUserAxes()
Deprecated.as of 1.373 System vs user difference are generalized into extension point.Gets the subset ofAxisList
that are not system axes.
-
getLayouter
public Layouter<MatrixConfiguration> getLayouter()
-
onCreatedFromScratch
public void onCreatedFromScratch()
- Specified by:
onCreatedFromScratch
in interfaceItem
- Overrides:
onCreatedFromScratch
in classAbstractProject<MatrixProject,MatrixBuild>
-
onLoad
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException
- Specified by:
onLoad
in interfaceItem
- Overrides:
onLoad
in classAbstractProject<MatrixProject,MatrixBuild>
- Throws:
IOException
-
logRotate
public void logRotate() throws IOException, InterruptedException
- Overrides:
logRotate
in classJob<MatrixProject,MatrixBuild>
- Throws:
IOException
InterruptedException
-
getActiveConfigurations
@Exported public Collection<MatrixConfiguration> getActiveConfigurations()
Gets all active configurations.In contract, inactive configurations are those that are left for archival purpose and no longer built when a new
MatrixBuild
is 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
public Collection<MatrixConfiguration> getItems()
- Specified by:
getItems
in interfaceItemGroup<MatrixConfiguration>
-
getAllJobs
public Collection<? extends Job> getAllJobs()
- Specified by:
getAllJobs
in interfaceItem
- Overrides:
getAllJobs
in classJob<MatrixProject,MatrixBuild>
-
getUrlChildPrefix
public String getUrlChildPrefix()
- Specified by:
getUrlChildPrefix
in interfaceItemGroup<MatrixConfiguration>
-
getItem
public MatrixConfiguration getItem(String name)
- Specified by:
getItem
in interfaceItemGroup<MatrixConfiguration>
-
getItem
public MatrixConfiguration getItem(Combination c)
-
getRootDirFor
@NonNull public File getRootDirFor(@NonNull MatrixConfiguration child)
Gets a root directory of the specifiedMatrixConfiguration
. Creates the whole directory hierarchy on-demand.- Specified by:
getRootDirFor
in interfaceItemGroup<MatrixConfiguration>
- Parameters:
child
- childMatrixConfiguration
- Returns:
- Root directory for the combination
-
onRenamed
public void onRenamed(MatrixConfiguration item, String oldName, String newName) throws IOException
- Specified by:
onRenamed
in interfaceItemGroup<MatrixConfiguration>
- Throws:
IOException
-
onDeleted
public void onDeleted(MatrixConfiguration item) throws IOException
- Specified by:
onDeleted
in interfaceItemGroup<MatrixConfiguration>
- Throws:
IOException
-
getRootDirFor
@NonNull public File getRootDirFor(@NonNull Combination combination)
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 public JDK getJDK()
Deprecated.- Overrides:
getJDK
in classAbstractProject<MatrixProject,MatrixBuild>
- See Also:
getJDKs()
-
getJDKs
@NonNull public Set<JDK> getJDKs()
Gets theJDK
s where the builds will be run.- Returns:
- never null but can be empty
-
getLabels
@NonNull public Set<Label> getLabels()
Gets theLabel
s where the builds will be run.- Returns:
- never null
-
getBuildersList
public DescribableList<Builder,Descriptor<Builder>> getBuildersList()
-
getPublishers
public Map<Descriptor<Publisher>,Publisher> getPublishers()
-
getPublishersList
public DescribableList<Publisher,Descriptor<Publisher>> getPublishersList()
- Specified by:
getPublishersList
in classAbstractProject<MatrixProject,MatrixBuild>
-
getBuildWrappersList
public DescribableList<BuildWrapper,Descriptor<BuildWrapper>> getBuildWrappersList()
- Specified by:
getBuildWrappersList
in interfaceBuildableItemWithBuildWrappers
-
getBuildWrappers
public Map<Descriptor<BuildWrapper>,BuildWrapper> getBuildWrappers()
-
getPublisher
public Publisher getPublisher(Descriptor<Publisher> descriptor)
-
getBuildClass
protected Class<MatrixBuild> getBuildClass()
- Specified by:
getBuildClass
in classAbstractProject<MatrixProject,MatrixBuild>
-
isFingerprintConfigured
public boolean isFingerprintConfigured()
- Specified by:
isFingerprintConfigured
in classAbstractProject<MatrixProject,MatrixBuild>
-
buildDependencyGraph
protected void buildDependencyGraph(DependencyGraph graph)
- Overrides:
buildDependencyGraph
in classAbstractProject<MatrixProject,MatrixBuild>
-
asProject
public MatrixProject asProject()
- Specified by:
asProject
in interfaceBuildableItemWithBuildWrappers
- Specified by:
asProject
in interfaceSCMedItem
-
getDynamic
public Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
- Overrides:
getDynamic
in classJob<MatrixProject,MatrixBuild>
-
submit
protected void submit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, Descriptor.FormException
- Overrides:
submit
in classAbstractProject<MatrixProject,MatrixBuild>
- Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException
-
doConfigDotXml
public void doConfigDotXml(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
- Overrides:
doConfigDotXml
in classAbstractItem
- Throws:
IOException
-
getAggregatedTestResultAction
public hudson.tasks.test.AggregatedTestResultAction getAggregatedTestResultAction()
-
doDoWipeOutWorkspace
public org.kohsuke.stapler.HttpResponse doDoWipeOutWorkspace() throws IOException, javax.servlet.ServletException, InterruptedException
Also delete all the workspaces of the configuration, too.- Overrides:
doDoWipeOutWorkspace
in classAbstractProject<MatrixProject,MatrixBuild>
- Throws:
IOException
javax.servlet.ServletException
InterruptedException
-
doChildrenContextMenu
public ModelObjectWithContextMenu.ContextMenu doChildrenContextMenu(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws Exception
- Specified by:
doChildrenContextMenu
in interfaceModelObjectWithChildren
- Overrides:
doChildrenContextMenu
in classJob<MatrixProject,MatrixBuild>
- Throws:
Exception
-
getDescriptor
public MatrixProject.DescriptorImpl getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<TopLevelItem>
- Specified by:
getDescriptor
in interfaceTopLevelItem
- Throws:
IllegalStateException
- Jenkins is not ready
-
alias
@Initializer(before=EXTENSIONS_AUGMENTED) public static void alias()
-
-