|
|
|
@@ -242,7 +242,7 @@ public class NewDatasetServiceImpl implements NewDatasetService { |
|
|
|
ci4sUsername = Boolean.TRUE.equals(datasetVo.getIsPublic()) ? Constant.Item_Public : loginUser.getUsername(); |
|
|
|
Map<String, Object> userInfo = JsonUtils.jsonToMap(userReq); |
|
|
|
// 创建分支 |
|
|
|
String branchName = StringUtils.isEmpty(datasetVo.getVersion()) ? "master" : datasetVo.getVersion(); |
|
|
|
String branchName = datasetVo.getVersion(); |
|
|
|
String owner = (String) userInfo.get("login"); |
|
|
|
|
|
|
|
String repositoryName = datasetVo.getIdentifier(); |
|
|
|
@@ -260,20 +260,20 @@ public class NewDatasetServiceImpl implements NewDatasetService { |
|
|
|
Map projectDetail = gitService.getProjectDetail(owner, repositoryName, token); |
|
|
|
|
|
|
|
//克隆 |
|
|
|
List<Map<String, Object>> brancheList = gitService.getBrancheList(token, owner, repositoryName); |
|
|
|
String oldBranch = (String) brancheList.stream() |
|
|
|
.filter(branch -> !"master".equals(branch.get("name"))).collect(Collectors.toList()).get(0).get("name"); |
|
|
|
// List<Map<String, Object>> brancheList = gitService.getBrancheList(token, owner, repositoryName); |
|
|
|
// String oldBranch = (String) brancheList.stream() |
|
|
|
// .filter(branch -> !"master".equals(branch.get("name"))).collect(Collectors.toList()).get(0).get("name"); |
|
|
|
|
|
|
|
dvcUtils.gitClone(localPath, projectUrl, oldBranch, gitLinkUsername, gitLinkPassword); |
|
|
|
dvcUtils.refreshRemoteBranches(localPath, gitLinkUsername, gitLinkPassword, oldBranch); |
|
|
|
dvcUtils.gitClone(localPath, projectUrl, "master", gitLinkUsername, gitLinkPassword); |
|
|
|
dvcUtils.refreshRemoteBranches(localPath, gitLinkUsername, gitLinkPassword, "master"); |
|
|
|
|
|
|
|
//检查是否存在本地重名分支,有的话干掉 |
|
|
|
//检查是否存在本地重名分支,有的话删掉 |
|
|
|
dvcUtils.deleteLocalBranch(localPath, branchName); |
|
|
|
// 创建本地分支 |
|
|
|
dvcUtils.createLocalBranchBasedOnMaster(localPath, branchName); |
|
|
|
|
|
|
|
//dvc checkout |
|
|
|
// dvcUtils.dvcPull(localPath); |
|
|
|
dvcUtils.dvcPull(localPath); |
|
|
|
dvcUtils.dvcCheckout(localPath); |
|
|
|
|
|
|
|
// 准备数据 |
|
|
|
@@ -330,7 +330,6 @@ public class NewDatasetServiceImpl implements NewDatasetService { |
|
|
|
// dvc 跟踪 |
|
|
|
dvcUtils.dvcAdd(localPath, "dataset"); |
|
|
|
dvcUtils.pushNewBranchToRemote(localPath, gitLinkUsername, gitLinkPassword, branchName); |
|
|
|
|
|
|
|
dvcUtils.dvcPush(localPath); |
|
|
|
|
|
|
|
// CompletableFuture.supplyAsync(() -> { |
|
|
|
|