🔨 修改插件包名.

This commit is contained in:
lijiahangmax
2025-09-09 22:27:51 +08:00
parent 0b7faa038a
commit 919e8383bf
5 changed files with 18 additions and 16 deletions

View File

@@ -24,7 +24,7 @@ RUN chmod +x /app/entrypoint.sh
# 复制 jar 包
COPY ./service/orion-visor-launch.jar /app/app.jar
# 复制探针包
ADD ./service/agent-release.tar.gz /app/agent-release
ADD ./service./instant-agent-release.tar.gz /app/instant-agent-release
# 启动检测
HEALTHCHECK --interval=15s --timeout=5s --retries=5 --start-period=10s \

View File

@@ -1,7 +1,7 @@
#!/bin/sh
AGENT_RELEASE_DIR="/root/orion/orion-visor/agent-release"
DEFAULT_AGENT_DIR="/app/agent-release"
AGENT_RELEASE_DIR="/root/orion/visor/instant-agent-release"
DEFAULT_AGENT_DIR="/app/instant-agent-release"
# 确保父目录存在
mkdir -p "$(dirname "$AGENT_RELEASE_DIR")"

View File

@@ -37,13 +37,15 @@ public interface FileConst {
String SCRIPT = "script";
String AGENT = "agent";
String INSTANT_AGENT_PATH = "instant-agent";
String AGENT_RELEASE = "agent-release";
String INSTANT_AGENT_NAME = "instant_agent";
String AGENT_RELEASE_TEMP = "agent-release-temp";
String INSTANT_AGENT_RELEASE = "instant-agent-release";
String AGENT_RELEASE_TAR_GZ = "agent-release.tar.gz";
String INSTANT_AGENT_RELEASE_TEMP = "instant-agent-release-temp";
String INSTANT_AGENT_RELEASE_TAR_GZ = "instant-agent-release.tar.gz";
String VERSION = ".version";

View File

@@ -86,7 +86,7 @@ public abstract class AbstractAgentInstaller implements AgentInstaller {
this.params = params;
this.logId = params.getLogId();
this.startScriptName = Const.START + HostOsTypeEnum.of(params.getOsType()).getScriptSuffix();
this.uploadAgentName = FileConst.AGENT + HostOsTypeEnum.of(params.getOsType()).getBinarySuffix();
this.uploadAgentName = FileConst.INSTANT_AGENT_NAME + HostOsTypeEnum.of(params.getOsType()).getBinarySuffix();
}
@Override
@@ -154,7 +154,7 @@ public abstract class AbstractAgentInstaller implements AgentInstaller {
protected String getAgentHomePath() {
return PathUtils.buildAppPath(HostOsTypeEnum.WINDOWS.name().equals(params.getOsType()),
sshConfig.getUsername(),
FileConst.AGENT) + Const.SLASH;
FileConst.INSTANT_AGENT_PATH) + Const.SLASH;
}
/**

View File

@@ -95,7 +95,7 @@ public class HostAgentServiceImpl implements HostAgentService {
public void readLocalAgentVersion() {
log.info("HostAgentService-readLocalAgentVersion start");
// 文件路径
String path = PathUtils.getOrionPath(FileConst.AGENT_RELEASE + Const.SLASH + FileConst.VERSION);
String path = PathUtils.getOrionPath(FileConst.INSTANT_AGENT_RELEASE + Const.SLASH + FileConst.VERSION);
log.info("HostAgentService-readLocalAgentVersion path: {}", path);
try {
if (!Files1.isFile(path)) {
@@ -191,9 +191,9 @@ public class HostAgentServiceImpl implements HostAgentService {
Valid.notBlank(fileName, ErrorMessage.FILE_EXTENSION_TYPE);
Valid.isTrue(fileName.endsWith(Const.SUFFIX_TAR_GZ), ErrorMessage.FILE_EXTENSION_TYPE);
// 保存文件
String releaseDir = PathUtils.getOrionPath(FileConst.AGENT_RELEASE);
String releaseTempDir = PathUtils.getOrionPath(FileConst.AGENT_RELEASE_TEMP);
File releaseTempFile = new File(releaseTempDir + Const.SLASH + FileConst.AGENT_RELEASE_TAR_GZ);
String releaseDir = PathUtils.getOrionPath(FileConst.INSTANT_AGENT_RELEASE);
String releaseTempDir = PathUtils.getOrionPath(FileConst.INSTANT_AGENT_RELEASE_TEMP);
File releaseTempFile = new File(releaseTempDir + Const.SLASH + FileConst.INSTANT_AGENT_RELEASE_TAR_GZ);
log.info("HostAgentService.installAgent start releaseTempDir: {}, releaseTempFile: {}", releaseTempDir, releaseTempFile.getAbsolutePath());
try {
// 创建目录
@@ -278,9 +278,9 @@ public class HostAgentServiceImpl implements HostAgentService {
.hostId(host.getId())
.osType(host.getOsType())
.agentKey(host.getAgentKey())
.agentFilePath(PathUtils.getOrionPath(FileConst.AGENT_RELEASE + Const.SLASH + agentFileName))
.configFilePath(PathUtils.getOrionPath(FileConst.AGENT_RELEASE + Const.SLASH + FileConst.CONFIG_YAML))
.startScriptPath(PathUtils.getOrionPath(FileConst.AGENT_RELEASE + Const.SLASH + Const.START + os.getScriptSuffix()))
.agentFilePath(PathUtils.getOrionPath(FileConst.INSTANT_AGENT_RELEASE + Const.SLASH + agentFileName))
.configFilePath(PathUtils.getOrionPath(FileConst.INSTANT_AGENT_RELEASE + Const.SLASH + FileConst.CONFIG_YAML))
.startScriptPath(PathUtils.getOrionPath(FileConst.INSTANT_AGENT_RELEASE + Const.SLASH + Const.START + os.getScriptSuffix()))
.build();
taskParams.add(params);
// 添加待检查文件