pull 代码异常记录tpiIDD
This commit is contained in:
parent
5a532e7b93
commit
e81b80c287
|
@ -87,8 +87,8 @@ public class GameService {
|
|||
try {
|
||||
FileUtils.forceMkdir(file);
|
||||
} catch (IOException e) {
|
||||
logger.error("克隆失败,创建版本库所在工作目录失败:{}", e);
|
||||
throw new GameException("克隆失败,创建版本库所在工作目录失败:" + e);
|
||||
logger.error("克隆失败,创建版本库所在工作目录" + tpiWorkSpace + "失败", e);
|
||||
throw new GameException("克隆失败,创建版本库所在工作目录失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ public class GameService {
|
|||
3);
|
||||
|
||||
if (result.getInteger("exitStatus") != 0) {
|
||||
logger.error("克隆失败!e: {}", result);
|
||||
logger.error("tpmGitURL:{} 克隆失败!e: {}", tpmGitURL, result);
|
||||
|
||||
throw new GameException("克隆失败,版本库地址:" + tpmGitURL);
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ public class GameService {
|
|||
// pull 操作之前,如果tpi本地版本库不存在,则克隆,主机名为origin
|
||||
int isRepoExist = ShellUtil.executeAndGetExitStatus("ls " + tpiRepoPath).getInteger("exitStatus");
|
||||
if (isRepoExist != 0) {
|
||||
logger.warn("版本库不存在,先克隆! tpiGitURL: {}", tpiGitURL);
|
||||
logger.warn("版本库不存在,先克隆! tpiGitURL: {}, tpiID: {}", tpiGitURL, tpiID);
|
||||
gitClone(path, tpiGitURL, "origin", tpiRepoName);
|
||||
}
|
||||
|
||||
|
@ -144,18 +144,18 @@ public class GameService {
|
|||
.executeAndGetExitStatus("cd " + tpiRepoPath + " && git remote | grep ^origin$");
|
||||
if (remoteExist.getInteger("exitStatus") != 0) {
|
||||
if (remoteExist.getString("out").contains("fatal")) {
|
||||
logger.warn("版本库不完整,先进行init操作");
|
||||
logger.warn("版本库不完整,先进行init操作, tpiID: {}, tpiGitURL {}", tpiID, tpiGitURL);
|
||||
ShellUtil.execute("cd " + tpiRepoPath + " && git init");
|
||||
}
|
||||
|
||||
logger.warn("origin主机名不存在,先添加主机名及其git地址,remoteName: {}, tpiGitURL: {}", "origin", tpiGitURL);
|
||||
logger.warn("origin主机名不存在,先添加主机名及其git地址,remoteName: {}, tpiGitURL: {}, tpiID: {}", "origin", tpiGitURL, tpiID);
|
||||
JSONObject addRemote = ShellUtil
|
||||
.executeAndGetExitStatus("cd " + tpiRepoPath + " && git remote add origin " + tpiGitURL, 3);
|
||||
if (addRemote.getInteger("exitStatus") != 0) {
|
||||
logger.error("origin主机名不存在,添加主机名失败");
|
||||
throw new GameException("origin主机名不存在,无法完成pull操作");
|
||||
logger.error("origin主机名不存在,添加主机名失败, tpiGitURL: {}, tpiID: {}", tpiGitURL, tpiID);
|
||||
throw new GameException("origin主机名不存在,无法完成pull操作,tpiID:" + tpiID);
|
||||
} else {
|
||||
logger.debug("origin主机名不存在,添加主机名成功");
|
||||
logger.debug("origin主机名不存在,添加主机名成功, tpiGitURL: {}, tpiID: {}", tpiGitURL, tpiID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -170,8 +170,8 @@ public class GameService {
|
|||
logger.debug("##----> gitpull 结束,总耗时间为:" + (currentPullEnd - currentPullStart));
|
||||
if (result.getInteger("exitStatus") != 0) {
|
||||
|
||||
logger.info("pullCommand: {}", pullCommand);
|
||||
logger.info("output: {}", result.getString("out"));
|
||||
logger.info("pullCommand: {}, tpiID: {}", pullCommand, tpiID);
|
||||
logger.info("output: {}, tpiID: {}", result.getString("out"), tpiID);
|
||||
|
||||
// 如果pull失败,先check一下,看是不是远端版本库HEAD丢失,如果是,进行修复
|
||||
check(tpiID, tpiGitURL);
|
||||
|
@ -179,7 +179,7 @@ public class GameService {
|
|||
|
||||
// 重新clone
|
||||
gitClone(path, tpiGitURL, "origin", tpiRepoName);
|
||||
logger.debug("gitPull冲突,重新clone结束");
|
||||
logger.debug("gitPull冲突,重新clone结束, tpiGitURL: {}, tpiID: {}", tpiGitURL, tpiID);
|
||||
|
||||
} else {
|
||||
// 判段是否成功拉取到更新
|
||||
|
@ -195,9 +195,9 @@ public class GameService {
|
|||
}
|
||||
|
||||
if (rePullTimes == 0) {
|
||||
logger.error("版本库有更新,2s之内拉取版本库更新失败!");
|
||||
logger.error("版本库有更新,2s之内拉取版本库更新失败!, tpiGitURL: {}, tpiID: {}", tpiGitURL, tpiID);
|
||||
} else {
|
||||
logger.debug("pull成功");
|
||||
logger.debug("pull成功, tpiGitURL: {}, tpiID: {}", tpiGitURL, tpiID);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue