Skip to content

Commit

Permalink
build hertzbeat package with jdk runtime (#1328)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsun28 authored Nov 10, 2023
1 parent 293fd2a commit 1f12ac9
Show file tree
Hide file tree
Showing 20 changed files with 1,009 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mvnw.bat
*.log
package-lock.json
*.zip
jdk/

### STS ###
.apt_generated
Expand Down
72 changes: 71 additions & 1 deletion collector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
<version>${maven-assembly-plugin.version}</version>
<executions>
<execution>
<id>make-zip</id>
<id>without-jdk</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
Expand All @@ -273,6 +273,76 @@
</descriptors>
</configuration>
</execution>
<execution>
<id>make-macos-arm64</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/collector/assembly-macos-arm64.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>make-macos-amd64</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/collector/assembly-macos-amd64.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>make-linux-arm64</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/collector/assembly-linux-arm64.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>make-linux-amd64</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/collector/assembly-linux-amd64.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>make-windows-64</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/collector/assembly-windows-64.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down
6 changes: 5 additions & 1 deletion manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Provides monitoring management, monitoring application configuration management,

The HertzBeat install package will at `manager/target/hertzbeat-{version}.tar.gz`

3. Execute command in collector
3. Build package with jdk

```mvn clean package -Pruntime```

4. Execute command in collector

```mvn clean package -Pcluster```
141 changes: 119 additions & 22 deletions manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,29 +204,126 @@
</archive>
</configuration>
</plugin>
<!--关键插件,maven提供的assembly插件,需要放在最后-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<executions>
<execution>
<id>make-zip</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<!--关键插件,maven提供的assembly插件,需要放在最后-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<executions>
<execution>
<id>make-zip</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>runtime</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<executions>
<execution>
<id>make-macos-arm64</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-macos-arm64.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>make-macos-amd64</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-macos-amd64.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>make-linux-arm64</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-linux-arm64.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>make-linux-amd64</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-linux-amd64.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>make-windows-64</id>
<!--绑定的maven操作-->
<phase>package</phase>
<!--运行一次-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-windows-64.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
60 changes: 60 additions & 0 deletions script/assembly/collector/assembly-linux-amd64.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--必填,会追加到打包文件名称的末尾-->
<id>linux_amd64_1.4.2</id>
<!--打包类型,可以设置多种类型,打包的时候不同的类型都会打包打出来-->
<formats>
<format>tar.gz</format>
</formats>
<!--第三方依赖设置-->
<dependencySets>
<dependencySet>
<!--使用项目中的artifact,第三方包打包进tar.gz文件的lib目录下-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>

<!--文件相关设置-->
<fileSets>
<!--bin文件下的所有脚本文件输出到打包后的bin目录下-->
<fileSet>
<directory>../script/assembly/collector/bin</directory>
<!-- 是否进行属性替换 即使用 ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>

<!-- src/main/resources目录下配置文件打包到config目录下 -->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>banner.txt</include>
<include>META-INF/**</include>
</includes>
<!-- 是否进行属性替换 即使用 ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>

<!-- 将target目录下的启动jar打包到目录下-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>

<!-- copy jdk -->
<fileSet>
<directory>../jdk/linux-amd64</directory>
<outputDirectory>java</outputDirectory>
</fileSet>
</fileSets>
</assembly>
60 changes: 60 additions & 0 deletions script/assembly/collector/assembly-linux-arm64.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--必填,会追加到打包文件名称的末尾-->
<id>linux_arm64_1.4.2</id>
<!--打包类型,可以设置多种类型,打包的时候不同的类型都会打包打出来-->
<formats>
<format>tar.gz</format>
</formats>
<!--第三方依赖设置-->
<dependencySets>
<dependencySet>
<!--使用项目中的artifact,第三方包打包进tar.gz文件的lib目录下-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>

<!--文件相关设置-->
<fileSets>
<!--bin文件下的所有脚本文件输出到打包后的bin目录下-->
<fileSet>
<directory>../script/assembly/collector/bin</directory>
<!-- 是否进行属性替换 即使用 ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>

<!-- src/main/resources目录下配置文件打包到config目录下 -->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>banner.txt</include>
<include>META-INF/**</include>
</includes>
<!-- 是否进行属性替换 即使用 ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>

<!-- 将target目录下的启动jar打包到目录下-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>

<!-- copy jdk -->
<fileSet>
<directory>../jdk/linux-arm64</directory>
<outputDirectory>java</outputDirectory>
</fileSet>
</fileSets>
</assembly>
Loading

0 comments on commit 1f12ac9

Please sign in to comment.