Package hudson.plugins.promoted_builds
Class Promotion
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.model.Run<P,R>
-
- hudson.model.AbstractBuild<PromotionProcess,Promotion>
-
- hudson.plugins.promoted_builds.Promotion
-
- All Implemented Interfaces:
ExtensionPoint
,DescriptorByNameOwner
,ModelObject
,PersistenceRoot
,Queue.Executable
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,Comparable<Promotion>
,Runnable
,LazyBuildMixIn.LazyLoadingRun<PromotionProcess,Promotion>
,ModelObjectWithContextMenu
,RunWithSCM<PromotionProcess,Promotion>
,OnMaster
,org.kohsuke.stapler.StaplerProxy
public class Promotion extends AbstractBuild<PromotionProcess,Promotion>
Records a promotion process.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Promotion.PromotionParametersAction
Action, which stores promotion parameters.protected class
Promotion.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, ModelObjectWithContextMenu.MenuItemType
-
-
Field Summary
Fields Modifier and Type Field Description static PermissionGroup
PERMISSIONS
static Permission
PROMOTE
-
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, previousBuild, project, QUEUE_ID_UNKNOWN, result, SKIP_PERMISSION_CHECK, timestamp, TREE_CUTOFF, UPDATE, XSTREAM, XSTREAM2
-
-
Constructor Summary
Constructors Constructor Description Promotion(PromotionProcess job)
Promotion(PromotionProcess project, File buildDir)
Promotion(PromotionProcess job, Calendar timestamp)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
buildParametersAction(List<Action> actions, AbstractBuild<?,?> build, List<ParameterValue> promotionParams)
Deprecated.UsePromotion.PromotionParametersAction
with constructor instead.static ParametersAction
createParametersAction(List<ParameterValue> parameters)
Factory method for creatingParametersAction
void
doRebuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
boolean
equals(Object obj)
EnvVars
getEnvironment(TaskListener listener)
List<ParameterDefinition>
getParameterDefinitionsWithValue()
Gets parameter definitions from theManualCondition
.static ParametersAction
getParametersActions(Promotion build)
List<ParameterValue>
getParameterValues()
AbstractBuild<?,?>
getRootBuild()
Status
getStatus()
AbstractBuild<?,?>
getTargetBuild()
Gets the build that this promotion promoted.AbstractBuild<?,?>
getTargetBuildOrFail()
Gets the build that this promotion promoted.String
getUrl()
String
getUserId()
Gets ID of theUser
, who triggered the promotion.String
getUserName()
Get a user name of the person, who triggered the promotion.int
hashCode()
static void
registerPermissions()
void
run()
-
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, getEnvironments, getHudsonVersion, getModuleRoot, getModuleRoots, getNextBuild, getParentExecutable, getPersistentActions, getPreviousBuild, getProject, 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, 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, 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, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
-
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
-
-
-
-
Field Detail
-
PERMISSIONS
public static final PermissionGroup PERMISSIONS
-
PROMOTE
public static final Permission PROMOTE
-
-
Constructor Detail
-
Promotion
public Promotion(PromotionProcess job) throws IOException
- Throws:
IOException
-
Promotion
public Promotion(PromotionProcess job, Calendar timestamp)
-
Promotion
public Promotion(PromotionProcess project, File buildDir) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getTargetBuild
@CheckForNull public AbstractBuild<?,?> getTargetBuild()
Gets the build that this promotion promoted.- Returns:
null
if there's no such object. For example, if the build has already garbage collected.- Since:
- 3.4
-
getTargetBuildOrFail
@NonNull public AbstractBuild<?,?> getTargetBuildOrFail()
Gets the build that this promotion promoted.- Returns:
- Target build
- Throws:
IllegalStateException
- There is no target build- Since:
- 3.5
-
getRootBuild
public AbstractBuild<?,?> getRootBuild()
- Overrides:
getRootBuild
in classAbstractBuild<PromotionProcess,Promotion>
-
getUrl
public String getUrl()
- Overrides:
getUrl
in classRun<PromotionProcess,Promotion>
-
getStatus
public Status getStatus()
-
getEnvironment
public EnvVars getEnvironment(TaskListener listener) throws IOException, InterruptedException
- Overrides:
getEnvironment
in classAbstractBuild<PromotionProcess,Promotion>
- Throws:
IOException
InterruptedException
-
getUserName
@NonNull public String getUserName()
Get a user name of the person, who triggered the promotion. The method tries various sources likeCause.UserIdCause
orManualCondition.Badge
.- Returns:
- user's name who triggered the promotion, or 'anonymous' if the search fails
-
getUserId
@NonNull public String getUserId()
Gets ID of theUser
, who triggered the promotion. The method tries various sources likeCause.UserIdCause
orManualCondition.Badge
.- Returns:
- ID of the user who triggered the promotion.
If the search fails, returns ID of
User.getUnknown()
. - Since:
- 2.22
-
getParameterValues
public List<ParameterValue> getParameterValues()
-
getParameterDefinitionsWithValue
@NonNull public List<ParameterDefinition> getParameterDefinitionsWithValue()
Gets parameter definitions from theManualCondition
.- Returns:
- List of parameter definitions to be presented.
May be empty if there is no
ManualCondition
.
-
doRebuild
public void doRebuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
- Throws:
IOException
-
run
public void run()
- Specified by:
run
in interfaceQueue.Executable
- Specified by:
run
in interfaceRunnable
- Specified by:
run
in classAbstractBuild<PromotionProcess,Promotion>
-
registerPermissions
@Initializer(before=SYSTEM_CONFIG_LOADED) @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public static void registerPermissions()
-
createParametersAction
public static ParametersAction createParametersAction(List<ParameterValue> parameters)
Factory method for creatingParametersAction
- Parameters:
parameters
-- Returns:
-
getParametersActions
public static ParametersAction getParametersActions(Promotion build)
-
buildParametersAction
@Deprecated public static void buildParametersAction(@NonNull List<Action> actions, @NonNull AbstractBuild<?,?> build, @CheckForNull List<ParameterValue> promotionParams)
Deprecated.UsePromotion.PromotionParametersAction
with constructor instead.Combine the target build parameters with the promotion build parameters- Parameters:
actions
-build
-promotionParams
-
-
-