Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create an assembly for the Minion, port the RPM spec to use it
- Loading branch information
Benjamin Reed
committed
Oct 17, 2016
1 parent
615ff47
commit c58bdc7
Showing
9 changed files
with
330 additions
and
57 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
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,141 @@ | ||
<?xml version="1.0"?> | ||
<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/maven-v4_0_0.xsd"> | ||
<parent> | ||
<groupId>org.opennms</groupId> | ||
<artifactId>org.opennms.assemblies</artifactId> | ||
<version>19.0.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.opennms.assemblies</groupId> | ||
<artifactId>org.opennms.assemblies.minion</artifactId> | ||
<packaging>jar</packaging> | ||
<name>OpenNMS Minion</name> | ||
<url>http://maven.apache.org</url> | ||
<properties> | ||
<INSTPREFIX>/opt/minion</INSTPREFIX> | ||
<SYSCONFDIR>/opt/minion/etc</SYSCONFDIR> | ||
</properties> | ||
<build> | ||
<resources> | ||
<resource> | ||
<filtering>true</filtering> | ||
<directory>src/main/filtered</directory> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<configuration> | ||
<encoding>UTF-8</encoding> | ||
<escapeString>\</escapeString> | ||
<delimiters> | ||
<delimiter>@</delimiter> | ||
</delimiters> | ||
<useDefaultDelimiters>false</useDefaultDelimiters> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>unpack-dependencies</id> | ||
<phase>process-resources</phase> | ||
<goals> | ||
<goal>unpack</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}</outputDirectory> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>org.opennms.features.minion.container</groupId> | ||
<artifactId>karaf</artifactId> | ||
<version>${project.version}</version> | ||
<type>tar.gz</type> | ||
</artifactItem> | ||
<artifactItem> | ||
<groupId>org.opennms.features.minion</groupId> | ||
<artifactId>repository</artifactId> | ||
<version>${project.version}</version> | ||
<classifier>repo</classifier> | ||
<type>tar.gz</type> | ||
<outputDirectory>${project.build.directory}/default</outputDirectory> | ||
</artifactItem> | ||
<artifactItem> | ||
<groupId>org.opennms.features.minion</groupId> | ||
<artifactId>core-repository</artifactId> | ||
<version>${project.version}</version> | ||
<classifier>repo</classifier> | ||
<type>tar.gz</type> | ||
<outputDirectory>${project.build.directory}/core</outputDirectory> | ||
</artifactItem> | ||
<artifactItem> | ||
<groupId>org.opennms</groupId> | ||
<artifactId>opennms-base-assembly</artifactId> | ||
<version>${project.version}</version> | ||
<classifier>daemon</classifier> | ||
<type>tar.gz</type> | ||
<outputDirectory>${project.build.directory}/base-assembly</outputDirectory> | ||
<includes>bin/find-java.sh</includes> | ||
</artifactItem> | ||
</artifactItems> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<configuration> | ||
<descriptors> | ||
<descriptor>src/assembly/minion.xml</descriptor> | ||
</descriptors> | ||
<tarLongFileMode>posix</tarLongFileMode> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.opennms.features.minion.container</groupId> | ||
<artifactId>karaf</artifactId> | ||
<version>${project.version}</version> | ||
<type>tar.gz</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.opennms.features.minion</groupId> | ||
<artifactId>core-repository</artifactId> | ||
<version>${project.version}</version> | ||
<classifier>repo</classifier> | ||
<type>tar.gz</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.opennms.features.minion</groupId> | ||
<artifactId>repository</artifactId> | ||
<version>${project.version}</version> | ||
<classifier>repo</classifier> | ||
<type>tar.gz</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.opennms</groupId> | ||
<artifactId>opennms-base-assembly</artifactId> | ||
<version>${project.version}</version> | ||
<classifier>daemon</classifier> | ||
<type>tar.gz</type> | ||
</dependency> | ||
</dependencies> | ||
</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,46 @@ | ||
<assembly | ||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd" | ||
> | ||
<id>minion</id> | ||
<formats> | ||
<format>tar.gz</format> | ||
</formats> | ||
<includeBaseDirectory>false</includeBaseDirectory> | ||
<fileSets> | ||
<fileSet> | ||
<directory>target/classes</directory> | ||
<outputDirectory>minion-${project.version}</outputDirectory> | ||
<includes> | ||
<include>debian/rules</include> | ||
<include>etc/minion.init</include> | ||
</includes> | ||
<fileMode>0755</fileMode> | ||
</fileSet> | ||
<fileSet> | ||
<directory>target/classes</directory> | ||
<outputDirectory>minion-${project.version}</outputDirectory> | ||
<excludes> | ||
<exclude>debian/rules</exclude> | ||
<exclude>etc/minion.init</exclude> | ||
</excludes> | ||
</fileSet> | ||
<fileSet> | ||
<directory>target/karaf-${project.version}</directory> | ||
<outputDirectory>minion-${project.version}</outputDirectory> | ||
</fileSet> | ||
<fileSet> | ||
<directory>target/core</directory> | ||
<outputDirectory>minion-${project.version}/repositories/core</outputDirectory> | ||
</fileSet> | ||
<fileSet> | ||
<directory>target/default</directory> | ||
<outputDirectory>minion-${project.version}/repositories/default</outputDirectory> | ||
</fileSet> | ||
<fileSet> | ||
<directory>target/base-assembly/bin</directory> | ||
<outputDirectory>minion-${project.version}/bin</outputDirectory> | ||
</fileSet> | ||
</fileSets> | ||
</assembly> |
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,81 @@ | ||
#!/usr/bin/make -f | ||
|
||
export DH_VERBOSE=1 | ||
export JAVA_HOME=$(shell opennms-base-assembly/src/main/filtered/bin/find-java.sh 1.8 1.8.9999) | ||
|
||
export OPTS_MAVEN="-Daether.connector.basic.threads=1 -Daether.connector.resumeDownloads=false" | ||
export OPTS_SKIP_TESTS="-DskipITs=true -Dmaven.test.skip.exec=true" | ||
export OPTS_SKIP_TARBALL="-Dbuild.skip.tarball=true" | ||
export OPTS_ASSEMBLIES="-Passemblies" | ||
export OPTS_PROFILES="-Prun-expensive-tasks" | ||
export COMPILE_PROJECTS="org.opennms.features.minion.container:karaf,org.opennms.features.minion:core-repository,org.opennms.features.minion:repository,org.opennms.features.minion:container-parent,org.opennms.features.minion:core-parent,org.opennms.features.minion:org.opennms.features.minion.heartbeat,org.opennms.features.minion:repository,org.opennms.features.minion:shell" | ||
export ASSEMBLY_PROJECTS=":org.opennms.assemblies.minion" | ||
|
||
export BUILDDEFINES=\ | ||
$(OPTS_MAVEN) \ | ||
$(OPTS_SKIP_TESTS) \ | ||
$(OPTS_SKIP_TARBALL) \ | ||
$(OPTS_PROFILES) \ | ||
-Duser.home=$(HOME) \ | ||
-Dbuild.profile=fulldir \ | ||
-Dopennms.home=/opt/minion \ | ||
-Ddist.dir=$(CURDIR)/debian \ | ||
-Ddist.name=temp | ||
|
||
STAMP_BUILD = debian/stamp-build | ||
|
||
configure: | ||
|
||
build: configure $(STAMP_BUILD) | ||
|
||
$(STAMP_BUILD): | ||
dh_testdir | ||
./compile.pl -N $(BUILDDEFINES) install | ||
if [ -z "$$OPENNMS_ENABLE_SNAPSHOTS" ] || [ "$$OPENNMS_ENABLE_SNAPSHOTS" = 1 ]; then export OPTS_ENABLE_SNAPSHOTS="-Denable.snapshots=true"; fi | ||
if [ -z "$$OPENNMS_SKIP_COMPILE" ] || [ "$$OPENNMS_SKIP_COMPILE" = 0 ]; then \ | ||
./compile.pl $(OPTS_SKIP_TESTS) $(OPTS_SKIP_TARBALL) $(OPTS_UPDATE_POLICY) $(BUILDDEFINES) $$OPTS_ENABLE_SNAPSHOTS --projects $(COMPILE_PROJECTS) --also-make install; \ | ||
fi | ||
./assemble.pl $(OPTS_SKIP_TESTS) $(OPTS_SKIP_TARBALL) $(OPTS_UPDATE_POLICY) $(BUILDDEFINES) $$OPTS_ENABLE_SNAPSHOTS --projects $(ASSEMBLY_PROJECTS) install | ||
find debian/temp -type d -name .svn -exec rm -rf {} \; | ||
find debian/temp -type d -name .git -exec rm -rf {} \; | ||
touch $(STAMP_BUILD) | ||
|
||
clean: | ||
dh_testdir | ||
dh_testroot | ||
./compile.pl $(OPTS_ASSEMBLIES) $(OPTS_PROFILES) $(BUILDDEFINES) clean | ||
rm -f opennms-remote-poller.{init,default} | ||
dh_clean | ||
rm -f $(STAMP_BUILD) | ||
|
||
install: | ||
dh_testdir | ||
dh_clean -k --exclude=temp | ||
dh_installdirs | ||
dh_testroot | ||
|
||
binary-indep: build install | ||
dh_testdir | ||
dh_testroot | ||
dh_installdocs | ||
#dh_installinit --package=opennms-server --name=opennms --no-start -u"defaults 21 19" | ||
#dh_installinit --package=opennms-remote-poller --no-start -u"defaults 21 19" | ||
dh_installman | ||
dh_installdebconf | ||
dh_link | ||
dh_strip | ||
dh_compress | ||
#dh_fixperms # Disabled to allow non-standard permissions | ||
dh_makeshlibs -n | ||
dh_installdeb | ||
#dh_perl debian/opennms-common/usr/share/opennms/bin debian/opennms-contrib/usr/share/opennms/contrib | ||
dh_shlibdeps | ||
dh_gencontrol | ||
dh_md5sums | ||
dh_builddeb | ||
|
||
# Build architecture-dependent files here. | ||
binary-arch: build install | ||
|
||
binary: binary-indep binary-arch | ||
.PHONY: build clean binary-indep binary-arch binary install configure |
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
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
Oops, something went wrong.