Browse Source

优化dvc测试

dev-check
chenzhihang 1 year ago
parent
commit
7985f9f1a1
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java

+ 6
- 3
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java View File

@@ -174,7 +174,6 @@ public class NewDatasetServiceImpl implements NewDatasetService {

// 创建分支
String branchName = datasetVo.getVersion();
// gitService.createBranch(token, owner, repositoryName, branchName, "master");

// 得到用户操作的路径
String sourcePath = datasetVo.getDatasetVersionVos().get(0).getUrl();
@@ -185,6 +184,11 @@ public class NewDatasetServiceImpl implements NewDatasetService {
// 命令行操作 git clone 项目地址
dvcUtils.gitClone(localPath1, projectUrl, "master", gitLinkUsername, gitLinkPassword);
dvcUtils.refreshRemoteBranches(localPath1, gitLinkUsername, gitLinkPassword, "master");
// 创建本地分支
dvcUtils.createLocalBranchBasedOnMaster(localPath, branchName);
//dvc checkout
dvcUtils.dvcPull(localPath1);
dvcUtils.dvcCheckout(localPath1);

String s3Path1 = bucketName + "/mini-model-management-platform-files" + "/" + relatePath1;
//删掉已存在文件夹
@@ -211,8 +215,7 @@ public class NewDatasetServiceImpl implements NewDatasetService {
// dvc 跟踪
dvcUtils.dvcAdd(localPath1, "dataset");
// git commit
dvcUtils.gitCommit(localPath1, "commit from ci4s with " + loginUser.getUsername());
dvcUtils.gitPush(localPath1, gitLinkUsername, gitLinkPassword);
dvcUtils.pushNewBranchToRemote(localPath1, gitLinkUsername, gitLinkPassword, branchName);
// dvc push 到远程S3
dvcUtils.dvcPush(localPath1);
} catch (Exception e) {


Loading…
Cancel
Save