Class GitService
java.lang.Object
org.qubership.atp.mia.service.git.GitService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckXKubeUserRights(String pathToGit) Check whether x_kube2vcs user is present in git repository members with maintainer rights.voiddownloadGitRepo(String repoUrl, Path toPath) Downloads GIT repository.executeGetAndParseGitInfoResponse(String urlSrc, String privateToken) Makes http request to git repository with config and return x_kube2vcs user info.getGitEncodedUrl(String pathToGit) Retrieves url from git path.voidGit clone.voidgitCommitAndPush(Path pathToGit, String commitMessagePrefix) Git commit.voidGit pull.voidinit()
-
Constructor Details
-
GitService
public GitService()
-
-
Method Details
-
checkXKubeUserRights
Check whether x_kube2vcs user is present in git repository members with maintainer rights.- Parameters:
pathToGit- url to git- Returns:
- empty string when success, otherwise validation error description.
-
downloadGitRepo
Downloads GIT repository.- Parameters:
repoUrl- repository URLtoPath- local path
-
executeGetAndParseGitInfoResponse
public Optional<GitInfoResponse> executeGetAndParseGitInfoResponse(String urlSrc, String privateToken) Makes http request to git repository with config and return x_kube2vcs user info.- Parameters:
urlSrc- to gitprivateToken- private token for git API, need to be generated in x_kube2vcs account.- Returns:
- parsed JSON object as
GitInfoResponse. - Throws:
MiaException- - when git API returns error.
-
getGitEmail
-
getGitEncodedUrl
Retrieves url from git path.- Parameters:
pathToGit- url to git- Returns:
- empty string if no success otherwise url.
-
getGitPass
-
getGitUser
-
gitClone
Git clone.- Parameters:
repoUrl- git URLtoPath- folder to clone
-
gitCommitAndPush
Git commit.- Parameters:
pathToGit- path to GIT
-
gitPull
Git pull.- Parameters:
pathToGit- path to GIT
-
init
-