Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Create debian from hraven-assembly using jdeb maven plugin #115

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
115 changes: 115 additions & 0 deletions hraven-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@
<description>hRaven - Assembly artifacts</description>
<packaging>pom</packaging>

<dependencies>
<dependency>
<groupId>com.twitter.hraven</groupId>
<artifactId>hraven-core</artifactId>
<version>0.9.16.inmobi-SNAPSHOT</version>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if the .inmobi- substring is needed here.. I think we don't want to include such suffixes in release versions.

</dependency>
<dependency>
<groupId>com.twitter.hraven</groupId>
<artifactId>hraven-etl</artifactId>
<version>0.9.16.inmobi-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
Expand All @@ -44,6 +56,109 @@
</descriptors>
</configuration>
</plugin>
<plugin>
<artifactId>jdeb</artifactId>
<groupId>org.vafer</groupId>
<version>1.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jdeb</goal>
</goals>
<configuration>
<verbose>true</verbose>
<skipPOMs>false</skipPOMs>
<compression>none</compression>
<installDir>/opt/${artifactId}</installDir>
<controlDir>${basedir}/src/deb/control</controlDir>
<deb>${basedir}/target/hraven_${version}.deb</deb>
<dataSet>
<data>
<src>${basedir}/src/deb/init.d</src>
<type>directory</type>
<mapper>
<type>perm</type>
<prefix>/etc/init.d</prefix>
<user>root</user>
<group>root</group>
<filemode>0755</filemode>
<dirmode>0755</dirmode>
</mapper>
</data>

<data>
<src>${basedir}/../conf</src>
<type>directory</type>
<mapper>
<type>perm</type>
<prefix>/opt/hraven/conf</prefix>
<user>root</user>
<group>root</group>
<filemode>0644</filemode>
<dirmode>0755</dirmode>
</mapper>
</data>


<data>
<src>${basedir}/../bin</src>
<type>directory</type>
<mapper>
<type>perm</type>
<prefix>/opt/hraven/bin</prefix>
<user>root</user>
<group>root</group>
<filemode>0755</filemode>
<dirmode>0755</dirmode>
</mapper>
</data>

<data>
<src>${basedir}/../hraven-core/target</src>
<type>directory</type>
<includes>*.jar</includes>
<mapper>
<type>perm</type>
<prefix>/opt/hraven/lib</prefix>
</mapper>
</data>

<data>
<src>${basedir}/../hraven-etl/target</src>
<type>directory</type>
<includes>*.jar</includes>
<mapper>
<type>perm</type>
<prefix>/opt/hraven/lib</prefix>
</mapper>
</data>

<data>
<src>${basedir}/../hraven-core/target/dependency</src>
<type>directory</type>
<includes>*.jar</includes>
<mapper>
<type>perm</type>
<prefix>/opt/hraven/lib</prefix>
</mapper>
</data>

<data>
<src>${basedir}/../hraven-etl/target/dependency</src>
<type>directory</type>
<includes>*.jar</includes>
<mapper>
<type>perm</type>
<prefix>/opt/hraven/lib</prefix>
</mapper>
</data>

</dataSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
7 changes: 7 additions & 0 deletions hraven-assembly/src/deb/control/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Package: hRaven
Version: [[version]]
Section: misc
Priority: low
Architecture: all
Description: [[description]]
Maintainer: hraven-dev@googlegroups.com
2 changes: 2 additions & 0 deletions hraven-assembly/src/deb/control/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! /bin/bash

8 changes: 8 additions & 0 deletions hraven-assembly/src/deb/control/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/bash
set -e;

HRAVEN_HOME="/opt/hraven"

if [ -d "$HRAVEN_HOME" ]; then
rm -rf $HRAVEN_HOME
fi
41 changes: 41 additions & 0 deletions hraven-assembly/src/deb/init.d/hraven
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Provides: hraven-rest-service
# Required-Start: $network $named $remote_fs $syslog
# Required-Stop: $network $named $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6

### END INIT INFO
HRAVEN_HOME=/opt/hraven
PATH=${GANGLIA_HOMEPATH}/sbin:${GANGLIA_HOMEPATH}/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=${HRAVEN_HOME}/bin/hraven-daemon.sh
NAME=hraven-rest-service
DESC="Hraven REST Service"

test -x $DAEMON || exit 0

set -e

case "$1" in
start)
echo -n "Starting $DESC: "
$DAEMON start rest
;;
stop)
echo -n "Stopping $DESC: "
$DAEMON stop rest
;;
reload)
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac

exit 0
32 changes: 16 additions & 16 deletions hraven-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,6 @@
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- configure the plugin here -->
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -158,6 +142,22 @@
<skipAssembly>true</skipAssembly>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependency</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
32 changes: 16 additions & 16 deletions hraven-etl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,6 @@
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- configure the plugin here -->
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -154,6 +138,22 @@
<skipAssembly>true</skipAssembly>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependency</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down