Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPM packages with maven #6

Merged
merged 7 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1.0:
- release
92 changes: 90 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.purbon.kafka</groupId>
<artifactId>topology-builder</artifactId>
<version>1.0-SNAPSHOT</version>
<artifactId>kafka-topology-builder</artifactId>
<version>0.9</version>

<name>A Kafka topology builder tool</name>
<description>
This tool is a helper project to orient Kafka Platform teams to build proper topic and configuration management automation
</description>
<url>https://github.com/purbon/</url>

<organization>
<name>Pere Urbon</name>
<url>https://github.com/purbon/</url>
</organization>

<profiles>
<profile>
Expand Down Expand Up @@ -67,6 +78,7 @@
</profiles>

<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -127,6 +139,80 @@
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.2.0</version>
<!--<executions>
<execution>
<id>generate-rpm</id>
<goals>
<goal>>attached-rpm</goal>
</goals>
</execution>
</executions>-->
<configuration>
<license>MIT (c) 2019, Pere Urbon</license>
<distribution>Trash 2019</distribution>
<group>Application/Collectors</group>
<packager>Pere Urbon</packager>
<prefix>/usr/local</prefix>
<changelogFile>src/changelog</changelogFile>
<defineStatements>
<defineStatement>_unpackaged_files_terminate_build 0</defineStatement>
</defineStatements>
<mappings>
<mapping>
<directory>/usr/local/kafka-topology-builder/bin</directory>
<filemode>440</filemode>
<username>ktb-kafka</username>
<groupname>ktb-kafka</groupname>
<sources>
<source>
<location>target/kafka-topology-builder-jar-with-dependencies.jar</location>
</source>
</sources>
</mapping>
<mapping>
<directory>/usr/local/kafka-topology-builder/conf</directory>
<configuration>true</configuration>
<filemode>640</filemode>
<username>ktb-kafka</username>
<groupname>ktb-kafka</groupname>
<sources>
<source>
<location>src/main/conf</location>
</source>
</sources>
</mapping>
<mapping>
<directory>/usr/local/bin</directory>
<filemode>750</filemode>
<username>ktb-kafka</username>
<groupname>ktb-kafka</groupname>
<sources>
<source>
<location>src/main/scripts</location>
</source>
</sources>
</mapping>
</mappings>
<!-- <preinstallScriptlet>
<script>echo "installing ${project.name} now"</script>
</preinstallScriptlet>
<postinstallScriptlet>
<scriptFile>src/main/scripts/postinstall</scriptFile>
<fileEncoding>utf-8</fileEncoding>
<filter>true</filter>
</postinstallScriptlet>
<preremoveScriptlet>
<scriptFile>src/main/scripts/preremove</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</preremoveScriptlet>

--> </configuration>
</plugin>

</plugins>
</build>

Expand Down Expand Up @@ -170,10 +256,12 @@


<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jackson.version>2.10.0</jackson.version>
<kafka.version>2.3.0</kafka.version>
<log4j.version>2.12.1</log4j.version>
</properties>

<dependencies>

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-pmd-plugin -->
Expand Down
6 changes: 6 additions & 0 deletions src/main/conf/admin-client.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bootstrap.servers=localhost:9092
security.protocol=SASL_PLAINTEXT
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required \
username="kafka" \
password="kafka";
25 changes: 25 additions & 0 deletions src/main/scripts/kafka-topology-builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

ARTIFACT="kafka-topology-builder-jar-with-dependencies.jar"

if
[ -z "$KAFKA_TOPOLOGY_HOME" ]; then
KAFKA_TOPOLOGY_HOME="/usr/local/kafka-topology-builder/bin"
fi


if
[ -z "$KAFKA_HEAP_OPTS" ]; then
KAFKA_HEAP_OPTS="-Xmx512M"
fi

# Which java to use
if [ -z "$JAVA_HOME" ]; then
JAVA="java"
else
JAVA="$JAVA_HOME/bin/java"
fi

JAR_PATH="$KAFKA_TOPOLOGY_HOME/$ARTIFACT"

exec $JAVA $KAFKA_HEAP_OPTS -jar $JAR_PATH "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ public void testTopicConfigSerdes() throws IOException {
topology.setProjects(Arrays.asList(project, project2));

String topologyYamlString = parser.serialise(topology);
System.out.println(topologyYamlString);

Topology deserTopology = parser.deserialise(topologyYamlString);

Project serdesProject = deserTopology.getProjects().get(0);
Expand Down