Class GitHubWorkingCopyManager
- java.lang.Object
-
- com.atlassian.bamboo.plugins.github.AbstractGitHubExecutor
-
- com.atlassian.bamboo.plugins.github.GitHubWorkingCopyManager
-
- All Implemented Interfaces:
MergingVcsWorkingCopyManager
,NoContextVcsWorkingCopyManager
,UpdatingVcsWorkingCopyManager
,VcsExecutorWithRequirements
,VcsWorkingCopyManager
public class GitHubWorkingCopyManager extends AbstractGitHubExecutor implements NoContextVcsWorkingCopyManager, MergingVcsWorkingCopyManager, UpdatingVcsWorkingCopyManager, VcsExecutorWithRequirements
-
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.plugins.github.AbstractGitHubExecutor
vcsRepositoryManager
-
-
Constructor Summary
Constructors Constructor Description GitHubWorkingCopyManager(VcsRepositoryManager vcsRepositoryManager, CapabilityContext capabilityContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull VcsWorkingCopy
checkoutAndMerge(@NotNull CommonContext commonContext, @NotNull VcsRepositoryData vcsRepositoryData, @NotNull VcsBranch targetBranch, @NotNull PlanVcsRevisionData revisionOnTarget, @NotNull VcsBranch sourceBranch, @NotNull PlanVcsRevisionData sourceRevision, @NotNull File targetPath)
Checks out the targetBranch and merges sourceBranch to it.@NotNull VcsWorkingCopy
commitLocal(@NotNull VcsWorkingCopy workingCopy, @NotNull VcsRepositoryData vcsRepositoryData, @NotNull String commitMessage)
Create a local commit.@NotNull Set<Requirement>
getRequirements(@NotNull VcsRepositoryData vcsRepositoryData)
@NotNull VcsWorkingCopy
retrieveSourceCode(@NotNull CommonContext commonContext, @NotNull VcsRepositoryData repositoryData, @NotNull PlanVcsRevisionData targetRevision, @NotNull File targetPath)
Checkout or update a working copy to a revision.@NotNull VcsWorkingCopy
updateRemote(@NotNull VcsWorkingCopy workingCopy, @NotNull VcsRepositoryData vcsRepositoryData, @NotNull String commitMessage)
Update remote repository.@NotNull VcsWorkingCopy
updateToLatestRevision(@NotNull CommonContext commonContext, @NotNull VcsRepositoryData repositoryData, @NotNull File targetPath)
Checkout or update a working copy to the latest revision.@NotNull VcsWorkingCopy
updateToLatestRevision(@NotNull VcsRepositoryData repositoryData, @NotNull File targetPath)
Checkout or update a working copy to the latest revision.@NotNull VcsWorkingCopy
updateToLatestRevisionForSpecs(@NotNull VcsRepositoryData repositoryData, @NotNull File targetPath)
Checkout or update a working copy to the latest revision.-
Methods inherited from class com.atlassian.bamboo.plugins.github.AbstractGitHubExecutor
getGitModuleDescriptor, githubToGitData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.vcs.runtime.MergingVcsWorkingCopyManager
canDoMerge, getMergingRequirements
-
Methods inherited from interface com.atlassian.bamboo.vcs.runtime.UpdatingVcsWorkingCopyManager
stageChanges
-
-
-
-
Constructor Detail
-
GitHubWorkingCopyManager
@Inject public GitHubWorkingCopyManager(VcsRepositoryManager vcsRepositoryManager, CapabilityContext capabilityContext)
-
-
Method Detail
-
commitLocal
@NotNull public @NotNull VcsWorkingCopy commitLocal(@NotNull @NotNull VcsWorkingCopy workingCopy, @NotNull @NotNull VcsRepositoryData vcsRepositoryData, @NotNull @NotNull String commitMessage) throws RepositoryException
Description copied from interface:UpdatingVcsWorkingCopyManager
Create a local commit. The exact meaning of this operation depends on repository type. In particular, it can be no-op for certain repository types, for example SVN. Intended use: creating a private revision that can be used later in the build.- Specified by:
commitLocal
in interfaceUpdatingVcsWorkingCopyManager
- Returns:
- updated state of local working copy
- Throws:
RepositoryException
-
updateToLatestRevision
@NotNull public @NotNull VcsWorkingCopy updateToLatestRevision(@NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull File targetPath) throws RepositoryException
Description copied from interface:NoContextVcsWorkingCopyManager
Checkout or update a working copy to the latest revision.- Specified by:
updateToLatestRevision
in interfaceNoContextVcsWorkingCopyManager
- Parameters:
repositoryData
- - configuration of a repository to checkout/updatetargetPath
- - workings copy's path. Note that some legacy implementation may ignore this parameter. (seeFixedDirectoryWorkingCopyManager
)- Returns:
- object representing created/updated working copy
- Throws:
RepositoryException
-
updateToLatestRevisionForSpecs
@NotNull public @NotNull VcsWorkingCopy updateToLatestRevisionForSpecs(@NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull File targetPath) throws RepositoryException
Description copied from interface:NoContextVcsWorkingCopyManager
Checkout or update a working copy to the latest revision. The method is desired to work with Specs.- Specified by:
updateToLatestRevisionForSpecs
in interfaceNoContextVcsWorkingCopyManager
- Parameters:
repositoryData
- - configuration of a repository to checkout/updatetargetPath
- - workings copy's path. Note that some legacy implementation may ignore this parameter. (seeFixedDirectoryWorkingCopyManager
)- Returns:
- object representing created/updated working copy
- Throws:
RepositoryException
-
retrieveSourceCode
@NotNull public @NotNull VcsWorkingCopy retrieveSourceCode(@NotNull @NotNull CommonContext commonContext, @NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull PlanVcsRevisionData targetRevision, @NotNull @NotNull File targetPath) throws RepositoryException
Description copied from interface:VcsWorkingCopyManager
Checkout or update a working copy to a revision.- Specified by:
retrieveSourceCode
in interfaceVcsWorkingCopyManager
- Parameters:
commonContext
- - a current build or deployment contextrepositoryData
- - configuration of a repository to checkout/updatetargetRevision
- - revision to check out or update totargetPath
- - workings copy's path. Note that some legacy implementation may ignore this parameter. (seeFixedDirectoryWorkingCopyManager
)- Returns:
- object representing created/updated working copy
- Throws:
RepositoryException
-
updateRemote
@NotNull public @NotNull VcsWorkingCopy updateRemote(@NotNull @NotNull VcsWorkingCopy workingCopy, @NotNull @NotNull VcsRepositoryData vcsRepositoryData, @NotNull @NotNull String commitMessage) throws RepositoryException
Description copied from interface:UpdatingVcsWorkingCopyManager
Update remote repository. The exact meaning of this operation depends on repository type. In DVCS case this should push pre-existing local commit to remote repository. In traditional vcs, like Subversion, this should execute commit operation. Intended use: publishing changes to the world.- Specified by:
updateRemote
in interfaceUpdatingVcsWorkingCopyManager
commitMessage
- - implementors are free to ignore this parameter.- Returns:
- updated state of local working copy
- Throws:
RepositoryException
-
checkoutAndMerge
@NotNull public @NotNull VcsWorkingCopy checkoutAndMerge(@NotNull @NotNull CommonContext commonContext, @NotNull @NotNull VcsRepositoryData vcsRepositoryData, @NotNull @NotNull VcsBranch targetBranch, @NotNull @NotNull PlanVcsRevisionData revisionOnTarget, @NotNull @NotNull VcsBranch sourceBranch, @NotNull @NotNull PlanVcsRevisionData sourceRevision, @NotNull @NotNull File targetPath) throws RepositoryException
Description copied from interface:MergingVcsWorkingCopyManager
Checks out the targetBranch and merges sourceBranch to it. Depending on the vcs type, this can create local commit.- Specified by:
checkoutAndMerge
in interfaceMergingVcsWorkingCopyManager
vcsRepositoryData
- configuration of the repository. Note that the following parameters override branch stored in repository data.targetBranch
- - target branch (branch to checkout and merge to)revisionOnTarget
- - revision to checkout and merge tosourceBranch
- - branch to merge fromsourceRevision
- - revision to merge fromtargetPath
- - workings copy's path- Returns:
- state of the working copy, including new revision if applicable
- Throws:
RepositoryException
-
updateToLatestRevision
@NotNull public @NotNull VcsWorkingCopy updateToLatestRevision(@NotNull @NotNull CommonContext commonContext, @NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull File targetPath) throws RepositoryException
Description copied from interface:VcsWorkingCopyManager
Checkout or update a working copy to the latest revision.- Specified by:
updateToLatestRevision
in interfaceVcsWorkingCopyManager
- Parameters:
commonContext
- - a current build or deployment contextrepositoryData
- - configuration of a repository to checkout/updatetargetPath
- - workings copy's path. Note that some legacy implementation may ignore this parameter. (seeFixedDirectoryWorkingCopyManager
)- Returns:
- object representing created/updated working copy
- Throws:
RepositoryException
-
getRequirements
@NotNull public @NotNull Set<Requirement> getRequirements(@NotNull @NotNull VcsRepositoryData vcsRepositoryData)
- Specified by:
getRequirements
in interfaceVcsExecutorWithRequirements
-
-