mirror of
https://gitee.com/BDWare/agent-backend
synced 2025-01-10 01:44:14 +00:00
feat: assign variable isDebug
This commit is contained in:
parent
18521aaf82
commit
ccdc33424e
@ -310,7 +310,10 @@ public class FileActions {
|
|||||||
}
|
}
|
||||||
fileMap.remove(target.getAbsolutePath());
|
fileMap.remove(target.getAbsolutePath());
|
||||||
updateTime.remove(target.getAbsolutePath());
|
updateTime.remove(target.getAbsolutePath());
|
||||||
String doi = unzipIfYpk(target, dir);
|
boolean isDebug =
|
||||||
|
transformedParam.containsKey("isDebug")
|
||||||
|
&& Boolean.parseBoolean(transformedParam.get("isDebug"));
|
||||||
|
String doi = unzipIfYpk(target, dir, isDebug);
|
||||||
if (null != doi) {
|
if (null != doi) {
|
||||||
retStr = retStr.replaceFirst("null", doi);
|
retStr = retStr.replaceFirst("null", doi);
|
||||||
}
|
}
|
||||||
@ -334,7 +337,7 @@ public class FileActions {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String unzipIfYpk(File target, File dir) {
|
private static String unzipIfYpk(File target, File dir, boolean isDebug) {
|
||||||
// [FileAction] unzipIfYpk,
|
// [FileAction] unzipIfYpk,
|
||||||
// target:/data/bdwaas/bdcontract/./BDWareProjectDir/private/045eeda3a001faad9d636ab1e973599ea87338a9576756eb10ceeca6083c1f76aac5cd201eab21c41342eb8aac40e9b283f0b6eae019644cdcc0a9f9aeb73de8fc/ContractUNknown.ypk targetDir:/data/bdwaas/bdcontract/./BDWareProjectDir/private/045eeda3a001faad9d636ab1e973599ea87338a9576756eb10ceeca6083c1f76aac5cd201eab21c41342eb8aac40e9b283f0b6eae019644cdcc0a9f9aeb73de8fc/ContractUNknown
|
// target:/data/bdwaas/bdcontract/./BDWareProjectDir/private/045eeda3a001faad9d636ab1e973599ea87338a9576756eb10ceeca6083c1f76aac5cd201eab21c41342eb8aac40e9b283f0b6eae019644cdcc0a9f9aeb73de8fc/ContractUNknown.ypk targetDir:/data/bdwaas/bdcontract/./BDWareProjectDir/private/045eeda3a001faad9d636ab1e973599ea87338a9576756eb10ceeca6083c1f76aac5cd201eab21c41342eb8aac40e9b283f0b6eae019644cdcc0a9f9aeb73de8fc/ContractUNknown
|
||||||
LOGGER.info(
|
LOGGER.info(
|
||||||
@ -364,7 +367,7 @@ public class FileActions {
|
|||||||
+ targetDir.getAbsolutePath());
|
+ targetDir.getAbsolutePath());
|
||||||
YJSPacker.unpack(target.getAbsolutePath(), targetDir.getAbsolutePath());
|
YJSPacker.unpack(target.getAbsolutePath(), targetDir.getAbsolutePath());
|
||||||
final File tempDir = targetDir;
|
final File tempDir = targetDir;
|
||||||
ContractManager.threadPool.execute(() -> startIfManifestDetected(tempDir));
|
ContractManager.threadPool.execute(() -> startIfManifestDetected(tempDir, isDebug));
|
||||||
target.delete();
|
target.delete();
|
||||||
|
|
||||||
// 注册DOI并更新Manifest
|
// 注册DOI并更新Manifest
|
||||||
@ -399,7 +402,7 @@ public class FileActions {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void startIfManifestDetected(File targetDir) {
|
public static void startIfManifestDetected(File targetDir, boolean isDebug) {
|
||||||
try {
|
try {
|
||||||
String contractName = targetDir.getName();
|
String contractName = targetDir.getName();
|
||||||
String owner = targetDir.getParentFile().getName();
|
String owner = targetDir.getParentFile().getName();
|
||||||
@ -416,6 +419,7 @@ public class FileActions {
|
|||||||
targetDir.getParentFile().getAbsolutePath(), contractName);
|
targetDir.getParentFile().getAbsolutePath(), contractName);
|
||||||
c.setScript(ypkPath);
|
c.setScript(ypkPath);
|
||||||
c.setOwner(owner);
|
c.setOwner(owner);
|
||||||
|
c.setDebug(isDebug);
|
||||||
CMActions.manager.startContractAndRedirect(c, System.out); // createPS()
|
CMActions.manager.startContractAndRedirect(c, System.out); // createPS()
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -241,6 +241,9 @@ public class MasterWSAction {
|
|||||||
if (args.has("isPrivate")) {
|
if (args.has("isPrivate")) {
|
||||||
request.put("isPrivate", args.get("isPrivate").getAsString());
|
request.put("isPrivate", args.get("isPrivate").getAsString());
|
||||||
}
|
}
|
||||||
|
if (args.has("isDebug")) {
|
||||||
|
contract.setDebug(args.get("isDebug").getAsBoolean());
|
||||||
|
}
|
||||||
request.put("pubKey", managerAction.getPubKey());
|
request.put("pubKey", managerAction.getPubKey());
|
||||||
request.put("action", "startContractTrustfully");
|
request.put("action", "startContractTrustfully");
|
||||||
request.put("requestID", requestID);
|
request.put("requestID", requestID);
|
||||||
|
@ -37,7 +37,7 @@ public class TemporyTestAction {
|
|||||||
@Action
|
@Action
|
||||||
public void startContractForTest(JsonObject args, ResultCallback resultCallback) {
|
public void startContractForTest(JsonObject args, ResultCallback resultCallback) {
|
||||||
FileActions.startIfManifestDetected(
|
FileActions.startIfManifestDetected(
|
||||||
new File(args.get("path").getAsString()).getAbsoluteFile());
|
new File(args.get("path").getAsString()).getAbsoluteFile(), true);
|
||||||
resultCallback.onResult("done");
|
resultCallback.onResult("done");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user