|
|
@@ -596,7 +596,7 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
String rootPath = localPath + ci4sUsername + "/model/" + gitlinIid + "/" + repositoryName; |
|
|
String rootPath = localPath + ci4sUsername + "/model/" + gitlinIid + "/" + repositoryName; |
|
|
String modelPath = rootPath + "/model"; |
|
|
String modelPath = rootPath + "/model"; |
|
|
String metaPath = rootPath + "/metadata"; |
|
|
String metaPath = rootPath + "/metadata"; |
|
|
String relatePath = ci4sUsername + "/model/" + gitlinIid + "/" + repositoryName+ "/model"; |
|
|
|
|
|
|
|
|
String relatePath = ci4sUsername + "/model/" + gitlinIid + "/" + repositoryName + "/model"; |
|
|
|
|
|
|
|
|
dvcUtils.gitClone(rootPath, projectUrl, branchName, gitLinkUsername, gitLinkPassword); |
|
|
dvcUtils.gitClone(rootPath, projectUrl, branchName, gitLinkUsername, gitLinkPassword); |
|
|
//干掉目标文件夹 |
|
|
//干掉目标文件夹 |
|
|
@@ -675,6 +675,10 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
String gitLinkUsername = loginUser.getSysUser().getGitLinkUsername(); |
|
|
String gitLinkUsername = loginUser.getSysUser().getGitLinkUsername(); |
|
|
String gitLinkPassword = loginUser.getSysUser().getGitLinkPassword(); |
|
|
String gitLinkPassword = loginUser.getSysUser().getGitLinkPassword(); |
|
|
|
|
|
|
|
|
|
|
|
// String ci4sUsername = "admin"; |
|
|
|
|
|
// String gitLinkUsername = "fanshuai"; |
|
|
|
|
|
// String gitLinkPassword = "h1n2x3j4y5@"; |
|
|
|
|
|
|
|
|
Map<String, Object> userInfo = getUserInfo(ci4sUsername, gitLinkUsername, gitLinkPassword); |
|
|
Map<String, Object> userInfo = getUserInfo(ci4sUsername, gitLinkUsername, gitLinkPassword); |
|
|
|
|
|
|
|
|
String repositoryName = modelsVo.getIdentifier() == null ? ci4sUsername + "_model_" + DateUtils.dateTimeNow() : modelsVo.getIdentifier(); |
|
|
String repositoryName = modelsVo.getIdentifier() == null ? ci4sUsername + "_model_" + DateUtils.dateTimeNow() : modelsVo.getIdentifier(); |
|
|
@@ -690,7 +694,6 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
String owner = (String) userInfo.get("login"); |
|
|
String owner = (String) userInfo.get("login"); |
|
|
|
|
|
|
|
|
String projectUrl = gitendpoint + "/" + owner + "/" + repositoryName + ".git"; |
|
|
String projectUrl = gitendpoint + "/" + owner + "/" + repositoryName + ".git"; |
|
|
String sourcePath = modelsVo.getModelVersionVos().get(0).getUrl(); |
|
|
|
|
|
String rootPath = localPath + ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName; |
|
|
String rootPath = localPath + ci4sUsername + "/model/" + modelsVo.getId() + "/" + repositoryName; |
|
|
String modelPath = rootPath + "/model"; |
|
|
String modelPath = rootPath + "/model"; |
|
|
String metaPath = rootPath + "/metadata"; |
|
|
String metaPath = rootPath + "/metadata"; |
|
|
@@ -709,7 +712,15 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
dvcUtils.dvcCheckout(rootPath); |
|
|
dvcUtils.dvcCheckout(rootPath); |
|
|
//干掉目标文件夹 |
|
|
//干掉目标文件夹 |
|
|
dvcUtils.deleteDirectory(modelPath); |
|
|
dvcUtils.deleteDirectory(modelPath); |
|
|
dvcUtils.moveFiles(sourcePath, modelPath); |
|
|
|
|
|
|
|
|
if (modelsVo.getModelVersionVos().size() != 0) { |
|
|
|
|
|
String sourcePath = modelsVo.getModelVersionVos().get(0).getUrl(); |
|
|
|
|
|
dvcUtils.moveFiles(sourcePath, modelPath); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (modelsVo.getModelVersionVos().size() != 0) { |
|
|
|
|
|
String sourcePath = modelsVo.getModelVersionVos().get(0).getUrl(); |
|
|
|
|
|
dvcUtils.moveFiles(sourcePath, modelPath); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//拼接生产的元数据后写入yaml文件 |
|
|
//拼接生产的元数据后写入yaml文件 |
|
|
ModelMetaVo modelMetaVo = new ModelMetaVo(); |
|
|
ModelMetaVo modelMetaVo = new ModelMetaVo(); |
|
|
@@ -779,7 +790,7 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
// 构建objectName |
|
|
// 构建objectName |
|
|
String username = SecurityUtils.getLoginUser().getUsername(); |
|
|
String username = SecurityUtils.getLoginUser().getUsername(); |
|
|
String fileName = file.getOriginalFilename(); |
|
|
String fileName = file.getOriginalFilename(); |
|
|
String path = localPath + "/temp/" + username + "/models/" + uuid; |
|
|
|
|
|
|
|
|
String path = localPath + "temp/" + username + "/models/" + uuid; |
|
|
long sizeInBytes = file.getSize(); |
|
|
long sizeInBytes = file.getSize(); |
|
|
String formattedSize = FileUtil.formatFileSize(sizeInBytes); |
|
|
String formattedSize = FileUtil.formatFileSize(sizeInBytes); |
|
|
File targetFile = new File(path, file.getOriginalFilename()); |
|
|
File targetFile = new File(path, file.getOriginalFilename()); |
|
|
|