public class GitBackend extends Object
| Modifier and Type | Field and Description |
|---|---|
protected hudson.FilePath |
repoPath
Path to the repository folder
|
| Constructor and Description |
|---|
GitBackend(hudson.model.AbstractBuild build,
hudson.Launcher launcher,
hudson.model.BuildListener listener,
hudson.plugins.git.GitSCM scm) |
| Modifier and Type | Method and Description |
|---|---|
void |
clean()
Cleans workspace from artifacts.
|
void |
clean(String revision) |
void |
closeBranch(String branch,
String message,
String username)
Close given branch.
|
void |
commit(String message,
String username)
Commit current workspace.
|
void |
createFile(String filename,
String content)
Create file in the repository folder
|
ReleaseBranch |
createReleaseBranch(String branch,
String releaseFilePath,
String releaseFileContent,
String message,
String username)
Create the release branch.
|
void |
ensureReleaseBranch(String branch,
String releaseFilePath,
String releaseFileContent,
String message,
String username)
Ensure the release branch exists.
|
String |
getBranch()
Get the current branch name in the workspace.
|
List<Branch> |
getBranches(boolean all)
Get branches from command line output,
and put them in a List with Branches so it's nice to work with.
|
List<String> |
getBranchNames(boolean all)
Get open Mercurial branches from command line output,
and put them in a List so it's nice to work with.
|
List<Branch> |
getLocalBranches()
Get local branches from command line output,
and put them in a List with Branches so it's nice to work with.
|
List<String> |
getLocalBranchNames()
Get branches from command line output,
and put them in a List so it's nice to work with.
|
ReleaseBranch |
getReleaseBranch(String branch)
Get release branch from given branch name.
|
void |
mergeHeads(String message,
String username)
Merge possible current branch's heads.
|
void |
mergeWorkspaceWith(String revision,
String updateTo)
Merge current workspace with given revision.
|
void |
pull()
Executes 'pull' command
|
void |
pull(String remote)
Pulls changes from remotes.
|
void |
pull(String remote,
String branch)
Pulls from given repository url.
|
void |
push(String... branchNames)
Executes 'push' command with -b
|
void |
stripLocal()
Strip out local commits which are not pushed yet.
|
void |
update(String revision)
Updates workspace to given revision/branch.
|
void |
updateClean(String revision)
Updates workspace to given revision/branch with cleaning.
|
public List<Branch> getBranches(boolean all) throws AdvancedSCMException
getBranches in interface AdvancedSCMManagerall - : get all or only open branchesAdvancedSCMExceptionpublic List<Branch> getLocalBranches() throws AdvancedSCMException
AdvancedSCMExceptionpublic List<String> getLocalBranchNames() throws AdvancedSCMException
AdvancedSCMExceptionpublic String getBranch() throws AdvancedSCMException
AdvancedSCMExceptionpublic void update(String revision) throws AdvancedSCMException
revision - : String with revision, hash or branchname to update to.AdvancedSCMExceptionpublic void updateClean(String revision) throws AdvancedSCMException
AdvancedSCMManagerrevision - : String with revision, hash of branchname to update to.AdvancedSCMExceptionpublic void stripLocal()
throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic void clean()
throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic void clean(String revision) throws AdvancedSCMException
AdvancedSCMExceptionpublic void mergeWorkspaceWith(String revision, String updateTo) throws AdvancedSCMException
AdvancedSCMManagerrevision - : String with revision, hash or branchname to merge with.updateTo - : String with revision, hash or branchname to update working copy to before actual merge.AdvancedSCMExceptionpublic void commit(String message, String username) throws AdvancedSCMException
AdvancedSCMManagermessage - : String commit messageusername - : String commit user name (with email)AdvancedSCMExceptionpublic void mergeHeads(String message, String username) throws AdvancedSCMException
message - : String commit messageusername - : String commit user name (with email)AdvancedSCMExceptionpublic void push(String... branchNames) throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic void pull()
throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic void pull(String remote) throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic void closeBranch(String branch, String message, String username)
branch: - String branch name.message - : String with message to give this commit.username - : String commit user name (with email)public void pull(String remote, String branch) throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic ReleaseBranch getReleaseBranch(String branch) throws ReleaseBranchInvalidException
AdvancedSCMManagerbranch - : String branch nameReleaseBranchInvalidExceptionpublic ReleaseBranch createReleaseBranch(String branch, String releaseFilePath, String releaseFileContent, String message, String username) throws AdvancedSCMException, ReleaseBranchInvalidException
AdvancedSCMManagercreateReleaseBranch in interface AdvancedSCMManagerbranch - : String branch namereleaseFileContent - : String release file contentAdvancedSCMExceptionReleaseBranchInvalidExceptionpublic List<String> getBranchNames(boolean all) throws AdvancedSCMException
AdvancedSCMManagergetBranchNames in interface AdvancedSCMManagerall - : get all or only open branchesAdvancedSCMExceptionpublic void ensureReleaseBranch(String branch, String releaseFilePath, String releaseFileContent, String message, String username) throws AdvancedSCMException, ReleaseBranchInvalidException
AdvancedSCMManagerensureReleaseBranch in interface AdvancedSCMManagerbranch - : String branch namereleaseFileContent - : String release file contentAdvancedSCMExceptionReleaseBranchInvalidExceptionpublic void createFile(String filename, String content) throws IOException, InterruptedException
filename: - String relative path to the file from the repository rootcontent: - String file content (UTF-8 encoding is hard-coded)IOExceptionInterruptedExceptionCopyright © 2004-2015. All Rights Reserved.