diff --git a/.github/workflows/build-push-docker.yml b/.github/workflows/build-push-docker.yml index 326a9ae..de12fa8 100644 --- a/.github/workflows/build-push-docker.yml +++ b/.github/workflows/build-push-docker.yml @@ -101,7 +101,7 @@ jobs: with: context: ./ # Path to the Dockerfile - file: ./localEnvironment/src/main/java/io/wdd/localenviroment/build-my-own-base-image.dockerfile + file: ./source/src/main/java/io/wdd/source/build-my-own-base-image.dockerfile platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.docker_tags_base.outputs.tags }} diff --git a/agent/src/main/java/io/wdd/agent/initial/bootup/reference/collectSystemInfo.java b/agent/src/main/java/io/wdd/agent/initial/bootup/reference/collectSystemInfo.java index c3c63c8..4e3cd90 100644 --- a/agent/src/main/java/io/wdd/agent/initial/bootup/reference/collectSystemInfo.java +++ b/agent/src/main/java/io/wdd/agent/initial/bootup/reference/collectSystemInfo.java @@ -1,30 +1,24 @@ -package io.wdd.agent.initial.bootup.reference; +package io.wdd.agent.initial.bootup; -import io.wdd.agent.initial.beans.ServerInfo; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; -import javax.annotation.PostConstruct; import javax.annotation.Resource; import java.net.InetAddress; -import java.util.Map; import java.util.Properties; @Configuration -@Slf4j -public class collectSystemInfo implements ApplicationContextAware { +public class collectSystemInfo { + + + @Resource Environment environment; - private ApplicationContext context; @Bean public void initialReadingEnvironment(){ @@ -39,25 +33,16 @@ public class collectSystemInfo implements ApplicationContextAware { Properties props =System.getProperties(); System.out.println("props = " + props); - System.out.println(); - - Map getenv = System.getenv(); - - System.out.println("getenv = " + getenv); - - System.out.println(); - - System.out.println("environment = " + environment); - - InetAddress loopbackAddress = InetAddress.getLoopbackAddress(); - - System.out.println("loopbackAddress = " + loopbackAddress); InetAddress ip = InetAddress.getLocalHost(); - String localName = ip.getHostName(); + System.out.println("ip = " + ip); + + System.out.println("environment = " + environment); + + String localName = ip.getHostName(); String osName = System.getProperty("os.name"); String userName = System.getProperty("user.name"); String osVersion = System.getProperty("os.version"); @@ -70,27 +55,10 @@ public class collectSystemInfo implements ApplicationContextAware { System.out.println("主机系统:" + osName); System.out.println("系统版本:" + osVersion); System.out.println("系统架构:" + osArch); - } catch (Exception e) { e.printStackTrace(); } } - @PostConstruct - private void getInjectServerInfo(){ - - log.info("getInjectServerInfo"); - - ServerInfo serverInfo = (ServerInfo) context.getBean("serverInfo"); - - - System.out.println("serverInfo = " + serverInfo); - - } - - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - this.context = applicationContext; - } }