Package io.jenkins.updatebot.commands
Class CommandContext
java.lang.Object
io.jenkins.updatebot.commands.CommandContext
- Direct Known Subclasses:
EnableFabric8Context
,PromoteContext
,PushRegexChangesContext
,PushSourceChangesContext
,PushVersionChangesContext
public class CommandContext extends Object
-
Constructor Summary
Constructors Constructor Description CommandContext(CommandContext parentContext)
CommandContext(LocalRepository repository, Configuration configuration)
-
Method Summary
Modifier and Type Method Description protected void
addChild(CommandContext child)
String
createCommit()
String
createIssueTitlePrefix()
String
createPullRequestBody()
String
createPullRequestTitle()
String
createPullRequestTitlePrefix()
StatusInfo
createStatusInfo()
void
error(org.slf4j.Logger log, String message)
void
error(org.slf4j.Logger log, String message, Throwable e)
File
file(String relativePath)
Returns the relative file path within the local repoprotected CommandContext
firstChild()
List<CommandContext>
getChildren()
String
getCloneUrl()
Configuration
getConfiguration()
File
getDir()
GitPlugin
getGit()
org.kohsuke.github.GHIssue
getIssue()
CommandContext
getParentContext()
org.kohsuke.github.GHPullRequest
getPullRequest()
LocalRepository
getRepository()
String
getRepositoryFullName()
Status
getStatus()
Set<File>
getUpdatedFiles()
org.kohsuke.github.GHRepository
gitHubRepository()
Returns the underlying github repository or null if its not a github repovoid
info(org.slf4j.Logger log, String message)
boolean
isUpdated()
Returns true if one or more files have been updatedvoid
removeChild(CommandContext child)
Lets remove a child context if it wasn't applicable (to avoid generating unnecessary change comments etcvoid
setIssue(org.kohsuke.github.GHIssue issue)
void
setPullRequest(org.kohsuke.github.GHPullRequest pullRequest)
void
setStatus(Status status)
void
updatedFile(File file)
PushVersionChangesContext
updateVersion(Kind kind, String name, String version)
void
warn(org.slf4j.Logger log, String message)
void
warn(org.slf4j.Logger log, String message, Throwable e)
-
Constructor Details
-
CommandContext
-
CommandContext
-
-
Method Details
-
getConfiguration
-
getParentContext
-
getChildren
-
getRepository
-
getIssue
public org.kohsuke.github.GHIssue getIssue() -
setIssue
public void setIssue(org.kohsuke.github.GHIssue issue) -
getPullRequest
public org.kohsuke.github.GHPullRequest getPullRequest() -
setPullRequest
public void setPullRequest(org.kohsuke.github.GHPullRequest pullRequest) -
getRepositoryFullName
-
getStatus
-
setStatus
-
isUpdated
public boolean isUpdated()Returns true if one or more files have been updated -
getUpdatedFiles
-
getCloneUrl
-
getDir
-
gitHubRepository
public org.kohsuke.github.GHRepository gitHubRepository()Returns the underlying github repository or null if its not a github repo -
file
Returns the relative file path within the local repo -
updatedFile
-
getGit
-
updateVersion
-
createPullRequestTitle
-
createIssueTitlePrefix
-
createPullRequestTitlePrefix
-
createCommit
-
createPullRequestBody
-
addChild
-
removeChild
Lets remove a child context if it wasn't applicable (to avoid generating unnecessary change comments etc -
firstChild
-
createStatusInfo
-
info
-
warn
-
warn
-
error
-
error
-