From 7985f9f1a1173fc650568df44aee3bcead9b39f0 Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Fri, 6 Jun 2025 09:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96dvc=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/service/impl/NewDatasetServiceImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java index 44cf842a..c9ceb2ca 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java @@ -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) {