Package hudson.plugins.promoted_builds
Class Promotion
- All Implemented Interfaces:
- ExtensionPoint,- DescriptorByNameOwner,- ModelObject,- PersistenceRoot,- Queue.Executable,- Saveable,- SearchableModelObject,- SearchItem,- AccessControlled,- Comparable<Promotion>,- Runnable,- WithConsoleUrl,- HistoricalBuild,- LazyBuildMixIn.LazyLoadingRun<PromotionProcess,,- Promotion> - ModelObjectWithContextMenu,- RunWithSCM<PromotionProcess,,- Promotion> - OnMaster,- org.kohsuke.stapler.StaplerProxy
Records a promotion process.
- Author:
- Kohsuke Kawaguchi
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classAction, which stores promotion parameters.protected classNested classes/interfaces inherited from class hudson.model.AbstractBuildAbstractBuild.AbstractBuildExecution, AbstractBuild.AbstractRunner, AbstractBuild.DependencyChangeNested classes/interfaces inherited from class hudson.model.RunRun.Artifact, Run.ArtifactList, Run.KeepLogBuildBadge, Run.RedirectUp, Run.RunExecution, Run.Runner, Run.RunnerAbortedException, Run.StatusSummarizer, Run.SummaryNested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenuModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
- 
Field SummaryFieldsFields inherited from class hudson.model.AbstractBuildbuildEnvironmentsFields inherited from class hudson.model.RunARTIFACTS, charset, DELETE, description, duration, FEED_ADAPTER, FEED_ADAPTER_LATEST, LIST_CUTOFF, nextBuild, number, ORDER_BY_DATE, previousBuild, project, QUEUE_ID_UNKNOWN, result, SKIP_PERMISSION_CHECK, timestamp, UPDATE, XSTREAM, XSTREAM2
- 
Constructor SummaryConstructorsConstructorDescriptionPromotion(PromotionProcess project, File buildDir) Promotion(PromotionProcess job, Calendar timestamp) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidbuildParametersAction(List<Action> actions, AbstractBuild<?, ?> build, List<ParameterValue> promotionParams) Deprecated.static ParametersActioncreateParametersAction(List<ParameterValue> parameters) Factory method for creatingParametersActionvoiddoRebuild(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) booleangetEnvironment(TaskListener listener) Gets parameter definitions from theManualCondition.static ParametersActiongetParametersActions(Promotion build) AbstractBuild<?,?> AbstractBuild<?,?> Gets the build that this promotion promoted.AbstractBuild<?,?> Gets the build that this promotion promoted.getUrl()Gets ID of theUser, who triggered the promotion.Get a user name of the person, who triggered the promotion.inthashCode()static voidvoidrun()Methods inherited from class hudson.model.AbstractBuildaddAction, calculateCulprits, createReference, doStop, doStop, dropLinks, due, getAggregatedTestResultAction, getBuildVariableResolver, getBuildVariables, getBuiltOn, getBuiltOnStr, getChangeSet, getChangeSets, getCulpritIds, getCulprits, getDependencyChanges, getDownstreamBuilds, getDownstreamBuilds, getDownstreamRelationship, getEnvironments, getHudsonVersion, getModuleRoot, getModuleRoots, getNextBuild, getParentExecutable, getPersistentActions, getPreviousBuild, getProject, getRunMixIn, getSensitiveBuildVariables, getTestResultAction, getTransitiveUpstreamBuilds, getUpstreamBuilds, getUpstreamRelationship, getUpstreamRelationshipBuild, getUpUrl, getWhyKeepLog, getWorkspace, hasChangeSetComputed, setBuiltOnStr, setWorkspace, shouldCalculateCulpritsMethods inherited from class hudson.model.Run_this, canToggleLogKeep, compareTo, delete, deleteArtifacts, doArtifact, doBuildNumber, doBuildStatus, doBuildTimestamp, doConfigSubmit, doConsoleText, doConsoleText, doDoDelete, doDoDelete, doProgressiveLog, doSubmitDescription, doToggleLogKeep, execute, fromExternalizableId, getAbsoluteUrl, getACL, getApi, getArtifactManager, getArtifacts, getArtifactsDir, getArtifactsUpTo, getBadgeActions, getBuildFingerprints, getBuildsOverThreshold, getBuildStatusSummary, getCause, getCauses, getCharacteristicEnvVars, getCharset, getConsoleUrl, getDescription, getDisplayName, getDuration, getDurationString, getDynamic, 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, hasCustomDisplayName, hasntStartedYet, isBuilding, isInProgress, isKeepLog, isLogUpdated, keepLog, keepLog, makeSearchIndex, onEndBuilding, onLoad, onStartBuilding, pickArtifactManager, reload, run, save, setDescription, setDisplayName, setQueueId, setResult, submit, toString, updateSymlinks, writeLogTo, writeReplace, writeWholeLogToMethods inherited from class hudson.model.ActionableaddOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, removeAction, removeActions, replaceAction, replaceActionsMethods inherited from class hudson.model.AbstractModelObjectgetSearch, getSearchIndex, getSearchName, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface hudson.security.AccessControlledcheckAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods inherited from interface hudson.model.DescriptorByNameOwnergetDescriptorByNameMethods inherited from interface jenkins.model.HistoricalBuildgetBuildStatusIconClassName, getBuildStatusUrl, getTruncatedDescriptionMethods inherited from interface hudson.model.Queue.ExecutablegetConsoleUrl, getEstimatedDuration, getParent, toStringMethods inherited from interface jenkins.scm.RunWithSCMhasParticipant
- 
Field Details- 
PERMISSIONS
- 
PROMOTE
 
- 
- 
Constructor Details- 
Promotion- Throws:
- IOException
 
- 
Promotion
- 
Promotion- Throws:
- IOException
 
 
- 
- 
Method Details- 
getTargetBuildGets the build that this promotion promoted.- Returns:
- nullif there's no such object. For example, if the build has already garbage collected.
- Since:
- 3.4
 
- 
getTargetBuildOrFailGets the build that this promotion promoted.- Returns:
- Target build
- Throws:
- IllegalStateException- There is no target build
- Since:
- 3.5
 
- 
getRootBuild- Overrides:
- getRootBuildin class- AbstractBuild<PromotionProcess,- Promotion> 
 
- 
getUrl- Specified by:
- getUrlin interface- HistoricalBuild
- Overrides:
- getUrlin class- Run<PromotionProcess,- Promotion> 
 
- 
getStatus
- 
getEnvironment- Overrides:
- getEnvironmentin class- AbstractBuild<PromotionProcess,- Promotion> 
- Throws:
- IOException
- InterruptedException
 
- 
getUserNameGet a user name of the person, who triggered the promotion. The method tries various sources likeCause.UserIdCauseorManualCondition.Badge.- Returns:
- user's name who triggered the promotion, or 'anonymous' if the search fails
 
- 
getUserIdGets ID of theUser, who triggered the promotion. The method tries various sources likeCause.UserIdCauseorManualCondition.Badge.- Returns:
- ID of the user who triggered the promotion.
         If the search fails, returns ID of User.getUnknown().
- Since:
- 2.22
 
- 
getParameterValues- Specified by:
- getParameterValuesin interface- HistoricalBuild
- Overrides:
- getParameterValuesin class- Run<PromotionProcess,- Promotion> 
 
- 
getParameterDefinitionsWithValueGets parameter definitions from theManualCondition.- Returns:
- List of parameter definitions to be presented.
         May be empty if there is no ManualCondition.
 
- 
doRebuildpublic void doRebuild(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException - Throws:
- IOException
 
- 
runpublic void run()- Specified by:
- runin interface- Queue.Executable
- Specified by:
- runin interface- Runnable
- Specified by:
- runin class- AbstractBuild<PromotionProcess,- Promotion> 
 
- 
registerPermissions@Initializer(before=SYSTEM_CONFIG_LOADED) @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public static void registerPermissions()
- 
hashCodepublic int hashCode()
- 
equals
- 
createParametersActionFactory method for creatingParametersAction- Parameters:
- parameters-
- Returns:
 
- 
getParametersActions
- 
buildParametersAction@Deprecated public static void buildParametersAction(@NonNull List<Action> actions, @NonNull AbstractBuild<?, ?> build, @CheckForNull List<ParameterValue> promotionParams) Deprecated.UsePromotion.PromotionParametersActionwith constructor instead.Combine the target build parameters with the promotion build parameters- Parameters:
- actions-
- build-
- promotionParams-
 
 
- 
Promotion.PromotionParametersActionwith constructor instead.