|
|
@ -70,6 +70,7 @@ public class VersionCheckUtils { |
|
|
|
private static final String GROUP = "group"; |
|
|
|
private static final String GROUP = "group"; |
|
|
|
private static final String BI = "bi"; |
|
|
|
private static final String BI = "bi"; |
|
|
|
private static final String BIPREFIX = "com.finebi"; |
|
|
|
private static final String BIPREFIX = "com.finebi"; |
|
|
|
|
|
|
|
private static final String DEVELOP_BRANCH_MARK = "#"; |
|
|
|
private static final Set<String> pluginsNeedIgnore = new HashSet<>(); |
|
|
|
private static final Set<String> pluginsNeedIgnore = new HashSet<>(); |
|
|
|
static { |
|
|
|
static { |
|
|
|
pluginsNeedIgnore.addAll(Arrays.asList( |
|
|
|
pluginsNeedIgnore.addAll(Arrays.asList( |
|
|
@ -88,7 +89,23 @@ public class VersionCheckUtils { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean versionCheck(String envName) { |
|
|
|
public static boolean versionCheck(String envName) { |
|
|
|
return checkLocalAndRemoteJartime(envName) && checkLocalAndRemotePlugin().size() == 0; |
|
|
|
if (needCheckConsistency(envName)) { |
|
|
|
|
|
|
|
return checkLocalAndRemoteJartime(envName) && checkLocalAndRemotePlugin().size() == 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 判断是否需要检查Jartime和插件的一致性 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param selectedEnvName 当前工作目录名称 |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private static boolean needCheckConsistency(String selectedEnvName) { |
|
|
|
|
|
|
|
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); |
|
|
|
|
|
|
|
DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(selectedEnvName); |
|
|
|
|
|
|
|
// 当前工作目录为远程工作目录时,需要检查
|
|
|
|
|
|
|
|
return selectedEnv.getType() == DesignerWorkspaceType.Remote; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static boolean versionCheck(DesignerWorkspaceInfo selectedEnv) { |
|
|
|
public static boolean versionCheck(DesignerWorkspaceInfo selectedEnv) { |
|
|
@ -139,21 +156,17 @@ public class VersionCheckUtils { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static boolean checkLocalAndRemoteJartime(DesignerWorkspaceInfo selectedEnv) { |
|
|
|
public static boolean checkLocalAndRemoteJartime(DesignerWorkspaceInfo selectedEnv) { |
|
|
|
//是否需要做服务校验
|
|
|
|
String localBranch; |
|
|
|
if (needCheckBranch(selectedEnv)) { |
|
|
|
String remoteBranch = getRemoteBranch(selectedEnv); |
|
|
|
String localBranch; |
|
|
|
localBranch = GeneralUtils.readFullBuildNO(); |
|
|
|
String remoteBranch = getRemoteBranch(selectedEnv); |
|
|
|
// 通过是否包含"#"来避免当前版本为非安装版本(主要是内部开发版本)
|
|
|
|
localBranch = GeneralUtils.readFullBuildNO(); |
|
|
|
if (localBranch.contains(DEVELOP_BRANCH_MARK) && ComparatorUtils.equals(localBranch, remoteBranch)) { |
|
|
|
//通过是否包含#来避免当前版本为非安装版本(主要是内部开发版本)
|
|
|
|
//说明版本一致,仅做日志记录
|
|
|
|
if (localBranch.contains("#") && ComparatorUtils.equals(localBranch, remoteBranch)) { |
|
|
|
FineLoggerFactory.getLogger().info("Remote Designer version consistency"); |
|
|
|
//说明版本一致,仅做日志记录
|
|
|
|
return true; |
|
|
|
FineLoggerFactory.getLogger().info("Remote Designer version consistency"); |
|
|
|
} else { |
|
|
|
return true; |
|
|
|
return false; |
|
|
|
} else { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static List<String> getNoExistServiceDescription(String envName) { |
|
|
|
public static List<String> getNoExistServiceDescription(String envName) { |
|
|
@ -267,10 +280,6 @@ public class VersionCheckUtils { |
|
|
|
return df.format(jarDate); |
|
|
|
return df.format(jarDate); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv) { |
|
|
|
|
|
|
|
return selectedEnv.getType() == DesignerWorkspaceType.Remote; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static JSONArray checkLocalAndRemotePlugin() { |
|
|
|
public static JSONArray checkLocalAndRemotePlugin() { |
|
|
|
JSONArray differentPlugins = new JSONArray(); |
|
|
|
JSONArray differentPlugins = new JSONArray(); |
|
|
|
JSONArray remotePlugins = FRContext.getCommonOperator().getPluginStatus(); |
|
|
|
JSONArray remotePlugins = FRContext.getCommonOperator().getPluginStatus(); |
|
|
|