-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create rpm packaging workflow * Depend on java headless * Do explicit mappings, move files around a bit * Fixes RAT mapping * Check for log4j2.xml as well before starting * Fixes license
- Loading branch information
1 parent
a314ce8
commit 506a142
Showing
10 changed files
with
292 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
upload: | ||
name: Upload | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
server-id: github | ||
settings-path: ${{ github.workspace }} | ||
|
||
- name: Build jar | ||
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean package | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build rpm | ||
run: cd rpm/ && mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= package -f rpm.pom.xml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Attach jar and rpm to release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
rpm/target/rpm/com.teragrep-rlp_11/RPMS/noarch/com.teragrep-rlp_11-*.rpm | ||
target/rlp_11-jar-with-dependencies.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.idea/ | ||
target/ | ||
rpm/target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<packaging>rpm</packaging> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>rlp_11</artifactId> | ||
<version>${revision}${sha1}${changelist}</version> | ||
<name>rlp_11</name> | ||
<description>rlp_11</description> | ||
<groupId>com.teragrep</groupId> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<revision>0.0.1</revision> | ||
<changelist>-SNAPSHOT</changelist> | ||
<sha1/> | ||
</properties> | ||
<build> | ||
<directory>${project.basedir}/target</directory> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>3.5.2</version> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-enforcer-plugin</artifactId> | ||
<version>3.5.0</version> | ||
<executions> | ||
<execution> | ||
<id>enforce</id> | ||
<phase>none</phase> | ||
</execution> | ||
<execution> | ||
<id>enforce-maven</id> | ||
<goals> | ||
<goal>enforce</goal> | ||
</goals> | ||
<configuration> | ||
<rules> | ||
<requireMavenVersion> | ||
<version>3.6.3</version> | ||
</requireMavenVersion> | ||
</rules> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>rpm-maven-plugin</artifactId> | ||
<version>2.3.0</version> | ||
<extensions>true</extensions> | ||
<executions> | ||
<execution> | ||
<id>default-rpm</id> | ||
<goals> | ||
<goal>rpm</goal> | ||
</goals> | ||
<phase>package</phase> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<summary>${project.groupId}-${project.artifactId}</summary> | ||
<name>${project.groupId}-${project.artifactId}</name> | ||
<version>${project.version}</version> | ||
<release>${env.BUILD_ID}</release> | ||
<license>AGPL</license> | ||
<distribution>Teragrep rlp_11</distribution> | ||
<vendor>https://teragrep.com/</vendor> | ||
<packager>Teragrep <servicedesk@teragrep.com></packager> | ||
<group>Teragrep/rlp_11</group> | ||
<description>${project.groupId}-${project.artifactId}</description> | ||
<needarch>false</needarch> | ||
<defaultUsername>srv-rlp_11</defaultUsername> | ||
<defaultGroupname>srv-rlp_11</defaultGroupname> | ||
<defaultFilemode>0644</defaultFilemode> | ||
<defaultDirmode>0755</defaultDirmode> | ||
<mappings> | ||
<mapping> | ||
<directory>/usr/lib/systemd/system</directory> | ||
<directoryIncluded>false</directoryIncluded> | ||
<sources> | ||
<source> | ||
<location>src/usr/lib/systemd/system</location> | ||
</source> | ||
</sources> | ||
</mapping> | ||
<mapping> | ||
<directory>/opt/teragrep/${project.artifactId}/etc</directory> | ||
<directoryIncluded>true</directoryIncluded> | ||
<filemode>755</filemode> | ||
</mapping> | ||
<mapping> | ||
<directory>/opt/teragrep/${project.artifactId}/etc</directory> | ||
<configuration>noreplace</configuration> | ||
<directoryIncluded>false</directoryIncluded> | ||
<username>srv-rlp_11</username> | ||
<groupname>srv-rlp_11</groupname> | ||
<recurseDirectories>false</recurseDirectories> | ||
<sources> | ||
<source> | ||
<location>${project.basedir}/src/opt/teragrep/rlp_11/etc/log4j2.xml</location> | ||
</source> | ||
<source> | ||
<location>${project.basedir}/src/opt/teragrep/rlp_11/etc/rlp_11.properties</location> | ||
</source> | ||
</sources> | ||
</mapping> | ||
<mapping> | ||
<directory>/opt/teragrep/${project.artifactId}/lib</directory> | ||
<directoryIncluded>true</directoryIncluded> | ||
<filemode>755</filemode> | ||
</mapping> | ||
<mapping> | ||
<directory>/opt/teragrep/${project.artifactId}/lib</directory> | ||
<directoryIncluded>false</directoryIncluded> | ||
<filemode>755</filemode> | ||
<dirmode>755</dirmode> | ||
<username>srv-rlp_11</username> | ||
<groupname>srv-rlp_11</groupname> | ||
<recurseDirectories>false</recurseDirectories> | ||
<sources> | ||
<source> | ||
<location>${project.basedir}/../target/rlp_11-jar-with-dependencies.jar</location> | ||
<destination>rlp_11.jar</destination> | ||
</source> | ||
</sources> | ||
</mapping> | ||
</mappings> | ||
<requires> | ||
<require>java-11-openjdk-headless</require> | ||
</requires> | ||
<preinstallScriptlet> | ||
<script> | ||
getent group srv-rlp_11 > /dev/null || groupadd -r srv-rlp_11; | ||
getent passwd srv-rlp_11 > /dev/null || useradd -r -g srv-rlp_11 -d /opt/teragrep/${project.artifactId} -s /sbin/nologin -c "Service User" srv-rlp_11; | ||
exit 0; | ||
</script> | ||
</preinstallScriptlet> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<version>3.1.3</version> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.13.0</version> | ||
<executions> | ||
<execution> | ||
<id>default-compile</id> | ||
<phase>compile</phase> | ||
<goals> | ||
<goal>compile</goal> | ||
</goals> | ||
<configuration> | ||
<skipMain>true</skipMain> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<Configuration> | ||
<Appenders> | ||
<Console name="STDOUT"> | ||
<PatternLayout pattern="%d{dd.MM.yyyy HH:mm:ss.SSS} [%level] [%logger] [%thread] %msg%ex%n" /> | ||
</Console> | ||
</Appenders> | ||
<Loggers> | ||
<Logger name="com.teragrep.rlp_11" level="info" additivity="false"> | ||
<AppenderRef ref="STDOUT"/> | ||
</Logger> | ||
<Root level="INFO"> | ||
<AppenderRef ref="STDOUT" /> | ||
</Root> | ||
</Loggers> | ||
</Configuration> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=com.teragrep.rlp_11 | ||
ConditionPathExists=/opt/teragrep/rlp_11/etc/rlp_11.properties | ||
ConditionPathExists=/opt/teragrep/rlp_11/etc/log4j2.xml | ||
|
||
[Service] | ||
ExecStart=/usr/lib/jvm/jre-11-openjdk/bin/java \ | ||
-DconfigurationPath=/opt/teragrep/rlp_11/etc/rlp_11.properties \ | ||
-Dlog4j2.configurationFile=file:/opt/teragrep/rlp_11/etc/log4j2.xml \ | ||
-jar /opt/teragrep/rlp_11/lib/rlp_11.jar | ||
User=srv-rlp_11 | ||
WorkingDirectory=/opt/teragrep/rlp_11 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=com.teragrep.rlp_11 instance %I | ||
ConditionPathExists=/opt/teragrep/rlp_11/etc/rlp_11.%I.properties | ||
ConditionPathExists=/opt/teragrep/rlp_11/etc/log4j2.%I.xml | ||
|
||
[Service] | ||
ExecStart=/usr/lib/jvm/jre-11-openjdk/bin/java \ | ||
-DconfigurationPath=/opt/teragrep/rlp_11/etc/rlp_11.%I.properties \ | ||
-Dlog4j2.configurationFile=file:/opt/teragrep/rlp_11/etc/log4j2.%I.xml \ | ||
-jar /opt/teragrep/rlp_11/lib/rlp_11.jar | ||
User=srv-rlp_11 | ||
WorkingDirectory=/opt/teragrep/rlp_11 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Metrics reporting name. Arbitrary string, only used for reporting purposes | ||
metrics.name=target | ||
# Metrics window size | ||
metrics.window=10000 | ||
# Metrics report interval, in seconds | ||
metrics.interval=60 | ||
|
||
# Delay between sending records, in milliseconds | ||
probe.interval=1000 | ||
|
||
# Prometheus endpoint port | ||
prometheus.port=8080 | ||
|
||
# Appname used in RELP record | ||
record.appname=rlp_11 | ||
# Hostname used in RELP record | ||
record.hostname=rlp_11 | ||
|
||
# RELP Server target address | ||
target.hostname=127.0.0.1 | ||
# Relp Server target port | ||
target.port=12345 | ||
# RELP Server reconnect interval, in milliseconds | ||
target.reconnectinterval=1000 |