mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-23 05:15:04 +00:00
Add properties files to configure startup and installation scripts
Many scripts are used to start/stop and install/uninstall elasticsearch. These scripts share a lot of configuration properties like directory paths, max value for a setting, default user etc. Most of the values are identical but some of them are different depending of the platform (Debian-based or Redhat-based OS), depending of the way elasticsearch is started (shell script, systemd, sysv-init...) or the way it is installed (zip, rpm, deb...). Today the values are duplicated in multiple places, making it difficult to maintain the scripts or to update a value. This pull request make this more uniform: values used in scripts must be defined in a common packaging.properties file. Each value can be overridden in another specific packaging.properties file for Debian or Redhat. All startup and installation scripts are filtered with the common then the custom packaging.properties files before being packaged as a zip/tar.gz/rpm/dpkf archive.
This commit is contained in:
parent
e8a42c6954
commit
168238dab6
Binary file not shown.
@ -3,10 +3,10 @@
|
|||||||
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/lib/${project.build.finalName}.jar:$ES_HOME/lib/*:$ES_HOME/lib/sigar/*"
|
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/lib/${project.build.finalName}.jar:$ES_HOME/lib/*:$ES_HOME/lib/sigar/*"
|
||||||
|
|
||||||
if [ "x$ES_MIN_MEM" = "x" ]; then
|
if [ "x$ES_MIN_MEM" = "x" ]; then
|
||||||
ES_MIN_MEM=256m
|
ES_MIN_MEM=${packaging.elasticsearch.heap.min}
|
||||||
fi
|
fi
|
||||||
if [ "x$ES_MAX_MEM" = "x" ]; then
|
if [ "x$ES_MAX_MEM" = "x" ]; then
|
||||||
ES_MAX_MEM=1g
|
ES_MAX_MEM=${packaging.elasticsearch.heap.max}
|
||||||
fi
|
fi
|
||||||
if [ "x$ES_HEAP_SIZE" != "x" ]; then
|
if [ "x$ES_HEAP_SIZE" != "x" ]; then
|
||||||
ES_MIN_MEM=$ES_HEAP_SIZE
|
ES_MIN_MEM=$ES_HEAP_SIZE
|
||||||
|
BIN
bin/service.bat
BIN
bin/service.bat
Binary file not shown.
238
pom.xml
238
pom.xml
@ -45,6 +45,16 @@
|
|||||||
<tests.heapdump.path>${basedir}/logs/</tests.heapdump.path>
|
<tests.heapdump.path>${basedir}/logs/</tests.heapdump.path>
|
||||||
<tests.topn>5</tests.topn>
|
<tests.topn>5</tests.topn>
|
||||||
<execution.hint.file>.local-${project.version}-execution-hints.log</execution.hint.file>
|
<execution.hint.file>.local-${project.version}-execution-hints.log</execution.hint.file>
|
||||||
|
|
||||||
|
<!-- Properties used for building RPM & DEB packages (see common/packaging.properties) -->
|
||||||
|
<packaging.elasticsearch.home.dir>/usr/share/elasticsearch</packaging.elasticsearch.home.dir>
|
||||||
|
<packaging.elasticsearch.conf.dir>/etc/elasticsearch</packaging.elasticsearch.conf.dir>
|
||||||
|
<packaging.elasticsearch.data.dir>/var/lib/elasticsearch</packaging.elasticsearch.data.dir>
|
||||||
|
<packaging.elasticsearch.user>elasticsearch</packaging.elasticsearch.user>
|
||||||
|
<packaging.elasticsearch.group>elasticsearch</packaging.elasticsearch.group>
|
||||||
|
<packaging.elasticsearch.work.dir>/var/run/elasticsearch</packaging.elasticsearch.work.dir>
|
||||||
|
<packaging.elasticsearch.log.dir>/var/log/elasticsearch</packaging.elasticsearch.log.dir>
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
@ -358,6 +368,12 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
||||||
|
<!-- This file contains all the common properties used to build
|
||||||
|
the different packages (tar.gz, deb, rpm) using Maven resources plugin -->
|
||||||
|
<filters>
|
||||||
|
<filter>src/packaging/common/packaging.properties</filter>
|
||||||
|
</filters>
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<directory>${basedir}/src/main/java</directory>
|
<directory>${basedir}/src/main/java</directory>
|
||||||
@ -932,14 +948,16 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<!-- Deb Packaging -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<!-- some infos https://github.com/tcurdt/jdeb/blob/master/docs/maven.md
|
<!-- some infos https://github.com/tcurdt/jdeb/blob/master/docs/maven.md -->
|
||||||
-->
|
|
||||||
<artifactId>jdeb</artifactId>
|
<artifactId>jdeb</artifactId>
|
||||||
<groupId>org.vafer</groupId>
|
<groupId>org.vafer</groupId>
|
||||||
<version>1.0.1</version>
|
<version>1.4</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<deb>${project.build.directory}/releases/${project.artifactId}-${project.version}.deb</deb>
|
<deb>${project.build.directory}/releases/${project.artifactId}-${project.version}.deb</deb>
|
||||||
|
<controlDir>${project.build.directory}/generated-packaging/deb/control</controlDir>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
@ -956,19 +974,19 @@
|
|||||||
<type>directory</type>
|
<type>directory</type>
|
||||||
<mapper>
|
<mapper>
|
||||||
<type>perm</type>
|
<type>perm</type>
|
||||||
<prefix>/usr/share/elasticsearch</prefix>
|
<prefix>${packaging.elasticsearch.home.dir}</prefix>
|
||||||
<user>root</user>
|
<user>root</user>
|
||||||
<group>root</group>
|
<group>root</group>
|
||||||
</mapper>
|
</mapper>
|
||||||
</data>
|
</data>
|
||||||
<data>
|
<data>
|
||||||
<!-- use the filtered one from the resources plugin -->
|
<!-- use the filtered one from the resources plugin -->
|
||||||
<src>${project.build.directory}/bin</src>
|
<src>${project.build.directory}/generated-packaging/deb/bin</src>
|
||||||
<type>directory</type>
|
<type>directory</type>
|
||||||
<excludes>*.bat, .DS_Store, *.exe</excludes>
|
<excludes>*.bat, .DS_Store, *.exe</excludes>
|
||||||
<mapper>
|
<mapper>
|
||||||
<type>perm</type>
|
<type>perm</type>
|
||||||
<prefix>/usr/share/elasticsearch/bin</prefix>
|
<prefix>${packaging.elasticsearch.home.dir}/bin</prefix>
|
||||||
<filemode>755</filemode>
|
<filemode>755</filemode>
|
||||||
<user>root</user>
|
<user>root</user>
|
||||||
<group>root</group>
|
<group>root</group>
|
||||||
@ -980,7 +998,7 @@
|
|||||||
<type>directory</type>
|
<type>directory</type>
|
||||||
<mapper>
|
<mapper>
|
||||||
<type>perm</type>
|
<type>perm</type>
|
||||||
<prefix>/usr/share/elasticsearch/lib</prefix>
|
<prefix>${packaging.elasticsearch.home.dir}/lib</prefix>
|
||||||
<user>root</user>
|
<user>root</user>
|
||||||
<group>root</group>
|
<group>root</group>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -991,7 +1009,7 @@
|
|||||||
<type>directory</type>
|
<type>directory</type>
|
||||||
<mapper>
|
<mapper>
|
||||||
<type>perm</type>
|
<type>perm</type>
|
||||||
<prefix>/usr/share/elasticsearch/lib/sigar</prefix>
|
<prefix>${packaging.elasticsearch.home.dir}/lib/sigar</prefix>
|
||||||
<user>root</user>
|
<user>root</user>
|
||||||
<group>root</group>
|
<group>root</group>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -1002,13 +1020,13 @@
|
|||||||
<type>directory</type>
|
<type>directory</type>
|
||||||
<mapper>
|
<mapper>
|
||||||
<type>perm</type>
|
<type>perm</type>
|
||||||
<prefix>/usr/share/elasticsearch/lib</prefix>
|
<prefix>${packaging.elasticsearch.home.dir}/lib</prefix>
|
||||||
<user>root</user>
|
<user>root</user>
|
||||||
<group>root</group>
|
<group>root</group>
|
||||||
</mapper>
|
</mapper>
|
||||||
</data>
|
</data>
|
||||||
<data>
|
<data>
|
||||||
<src>${project.basedir}/src/deb/default/</src>
|
<src>${project.build.directory}/generated-packaging/deb/default/</src>
|
||||||
<type>directory</type>
|
<type>directory</type>
|
||||||
<excludes>.DS_Store</excludes>
|
<excludes>.DS_Store</excludes>
|
||||||
<mapper>
|
<mapper>
|
||||||
@ -1019,7 +1037,7 @@
|
|||||||
</mapper>
|
</mapper>
|
||||||
</data>
|
</data>
|
||||||
<data>
|
<data>
|
||||||
<src>${project.basedir}/src/deb/init.d/</src>
|
<src>${project.build.directory}/generated-packaging/deb/init.d/</src>
|
||||||
<type>directory</type>
|
<type>directory</type>
|
||||||
<excludes>.DS_Store</excludes>
|
<excludes>.DS_Store</excludes>
|
||||||
<mapper>
|
<mapper>
|
||||||
@ -1031,7 +1049,7 @@
|
|||||||
</mapper>
|
</mapper>
|
||||||
</data>
|
</data>
|
||||||
<data>
|
<data>
|
||||||
<src>${project.basedir}/src/deb/systemd/elasticsearch.service</src>
|
<src>${project.build.directory}/generated-packaging/deb/systemd/elasticsearch.service</src>
|
||||||
<dst>/usr/lib/systemd/system/elasticsearch.service</dst>
|
<dst>/usr/lib/systemd/system/elasticsearch.service</dst>
|
||||||
<type>file</type>
|
<type>file</type>
|
||||||
</data>
|
</data>
|
||||||
@ -1041,13 +1059,13 @@
|
|||||||
<excludes>.DS_Store</excludes>
|
<excludes>.DS_Store</excludes>
|
||||||
<mapper>
|
<mapper>
|
||||||
<type>perm</type>
|
<type>perm</type>
|
||||||
<prefix>/etc/elasticsearch</prefix>
|
<prefix>${packaging.elasticsearch.conf.dir}</prefix>
|
||||||
<user>root</user>
|
<user>root</user>
|
||||||
<group>root</group>
|
<group>root</group>
|
||||||
</mapper>
|
</mapper>
|
||||||
</data>
|
</data>
|
||||||
<data>
|
<data>
|
||||||
<src>${project.basedir}/src/deb/lintian</src>
|
<src>${project.build.directory}/generated-packaging/deb/lintian</src>
|
||||||
<type>directory</type>
|
<type>directory</type>
|
||||||
<excludes>.DS_Store</excludes>
|
<excludes>.DS_Store</excludes>
|
||||||
<mapper>
|
<mapper>
|
||||||
@ -1058,22 +1076,89 @@
|
|||||||
</mapper>
|
</mapper>
|
||||||
</data>
|
</data>
|
||||||
<data>
|
<data>
|
||||||
<src>${project.basedir}/src/deb/copyright</src>
|
<src>${project.build.directory}/generated-packaging/deb/copyright</src>
|
||||||
<dst>/usr/share/doc/elasticsearch/copyright</dst>
|
<dst>/usr/share/doc/elasticsearch/copyright</dst>
|
||||||
<type>file</type>
|
<type>file</type>
|
||||||
</data>
|
</data>
|
||||||
|
<!-- Adds and sets permission on default directories -->
|
||||||
|
<data>
|
||||||
|
<type>template</type>
|
||||||
|
<paths>
|
||||||
|
<path>${packaging.elasticsearch.data.dir}</path>
|
||||||
|
<path>${packaging.elasticsearch.log.dir}</path>
|
||||||
|
<path>${packaging.elasticsearch.work.dir}</path>
|
||||||
|
</paths>
|
||||||
|
<mapper>
|
||||||
|
<type>perm</type>
|
||||||
|
<dirmode>755</dirmode>
|
||||||
|
<user>${packaging.elasticsearch.user}</user>
|
||||||
|
<group>${packaging.elasticsearch.group}</group>
|
||||||
|
</mapper>
|
||||||
|
</data>
|
||||||
</dataSet>
|
</dataSet>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<!-- use packaging.properties when building the .deb package -->
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-resources-deb</id>
|
||||||
|
<phase>prepare-package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/generated-packaging/deb/</outputDirectory>
|
||||||
|
<filters>
|
||||||
|
<filter>src/packaging/common/packaging.properties</filter>
|
||||||
|
<filter>src/packaging/deb/packaging.properties</filter>
|
||||||
|
</filters>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/packaging/common/</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<includes>
|
||||||
|
<include>**/*</include>
|
||||||
|
</includes>
|
||||||
|
<excludes>
|
||||||
|
<exclude>packaging.properties</exclude>
|
||||||
|
</excludes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/packaging/deb/</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<includes>
|
||||||
|
<include>**/*</include>
|
||||||
|
</includes>
|
||||||
|
<excludes>
|
||||||
|
<exclude>packaging.properties</exclude>
|
||||||
|
</excludes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.basedir}</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<includes>
|
||||||
|
<include>bin/elasticsearch</include>
|
||||||
|
<include>bin/elasticsearch.in.sh</include>
|
||||||
|
<include>bin/plugin</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- Rpm Packaging -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>rpm-maven-plugin</artifactId>
|
<artifactId>rpm-maven-plugin</artifactId>
|
||||||
<version>2.1-alpha-3</version>
|
<version>2.1.2</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<copyright>2015, Elasticsearch</copyright>
|
|
||||||
<distribution>Elasticsearch</distribution>
|
<distribution>Elasticsearch</distribution>
|
||||||
<group>Application/Internet</group>
|
<group>Application/Internet</group>
|
||||||
<packager>Elasticsearch</packager>
|
<packager>Elasticsearch</packager>
|
||||||
@ -1089,7 +1174,7 @@
|
|||||||
<defaultGroupname>root</defaultGroupname>
|
<defaultGroupname>root</defaultGroupname>
|
||||||
<mappings>
|
<mappings>
|
||||||
<mapping>
|
<mapping>
|
||||||
<directory>/etc/elasticsearch/</directory>
|
<directory>${packaging.elasticsearch.conf.dir}/</directory>
|
||||||
<configuration>noreplace</configuration>
|
<configuration>noreplace</configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>
|
||||||
@ -1105,7 +1190,7 @@
|
|||||||
<configuration>noreplace</configuration>
|
<configuration>noreplace</configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>
|
||||||
<location>src/rpm/sysconfig</location>
|
<location>${project.build.directory}/generated-packaging/rpm/sysconfig</location>
|
||||||
<includes>
|
<includes>
|
||||||
<include>elasticsearch</include>
|
<include>elasticsearch</include>
|
||||||
</includes>
|
</includes>
|
||||||
@ -1118,7 +1203,7 @@
|
|||||||
<configuration>true</configuration>
|
<configuration>true</configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>
|
||||||
<location>src/rpm/init.d/elasticsearch</location>
|
<location>${project.build.directory}/generated-packaging/rpm/init.d/elasticsearch</location>
|
||||||
</source>
|
</source>
|
||||||
</sources>
|
</sources>
|
||||||
</mapping>
|
</mapping>
|
||||||
@ -1128,7 +1213,7 @@
|
|||||||
<configuration>true</configuration>
|
<configuration>true</configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>
|
||||||
<location>src/rpm/systemd</location>
|
<location>${project.build.directory}/generated-packaging/rpm/systemd</location>
|
||||||
<includes>
|
<includes>
|
||||||
<include>elasticsearch.service</include>
|
<include>elasticsearch.service</include>
|
||||||
</includes>
|
</includes>
|
||||||
@ -1141,7 +1226,7 @@
|
|||||||
<configuration>true</configuration>
|
<configuration>true</configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>
|
||||||
<location>src/rpm/systemd/sysctl.d</location>
|
<location>${project.build.directory}/generated-packaging/rpm/systemd/sysctl.d</location>
|
||||||
<includes>
|
<includes>
|
||||||
<include>elasticsearch.conf</include>
|
<include>elasticsearch.conf</include>
|
||||||
</includes>
|
</includes>
|
||||||
@ -1153,7 +1238,7 @@
|
|||||||
<configuration>true</configuration>
|
<configuration>true</configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>
|
||||||
<location>src/rpm/systemd/</location>
|
<location>${project.build.directory}/generated-packaging/rpm/systemd/</location>
|
||||||
<includes>
|
<includes>
|
||||||
<include>elasticsearch.conf</include>
|
<include>elasticsearch.conf</include>
|
||||||
</includes>
|
</includes>
|
||||||
@ -1161,29 +1246,29 @@
|
|||||||
</sources>
|
</sources>
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping>
|
<mapping>
|
||||||
<directory>/var/run/elasticsearch/</directory>
|
<directory>${packaging.elasticsearch.work.dir}/</directory>
|
||||||
<filemode>755</filemode>
|
<filemode>755</filemode>
|
||||||
<username>elasticsearch</username>
|
<username>${packaging.elasticsearch.user}</username>
|
||||||
<groupname>elasticsearch</groupname>
|
<username>${packaging.elasticsearch.group}</username>
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping>
|
<mapping>
|
||||||
<directory>/var/lib/elasticsearch/</directory>
|
<directory>${packaging.elasticsearch.data.dir}/</directory>
|
||||||
<filemode>755</filemode>
|
<filemode>755</filemode>
|
||||||
<username>elasticsearch</username>
|
<username>${packaging.elasticsearch.user}</username>
|
||||||
<groupname>elasticsearch</groupname>
|
<username>${packaging.elasticsearch.group}</username>
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping>
|
<mapping>
|
||||||
<directory>/var/log/elasticsearch/</directory>
|
<directory>${packaging.elasticsearch.log.dir}/</directory>
|
||||||
<filemode>755</filemode>
|
<filemode>755</filemode>
|
||||||
<username>elasticsearch</username>
|
<username>${packaging.elasticsearch.user}</username>
|
||||||
<groupname>elasticsearch</groupname>
|
<username>${packaging.elasticsearch.group}</username>
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping>
|
<mapping>
|
||||||
<directory>/usr/share/elasticsearch/bin/</directory>
|
<directory>${packaging.elasticsearch.home.dir}/bin/</directory>
|
||||||
<filemode>755</filemode>
|
<filemode>755</filemode>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>
|
||||||
<location>target/bin</location>
|
<location>${project.build.directory}/generated-packaging/rpm/bin</location>
|
||||||
<includes>
|
<includes>
|
||||||
<include>elasticsearch</include>
|
<include>elasticsearch</include>
|
||||||
<include>elasticsearch.in.sh</include>
|
<include>elasticsearch.in.sh</include>
|
||||||
@ -1193,7 +1278,7 @@
|
|||||||
</sources>
|
</sources>
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping>
|
<mapping>
|
||||||
<directory>/usr/share/elasticsearch/lib</directory>
|
<directory>${packaging.elasticsearch.home.dir}/lib</directory>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>
|
||||||
<location>target/lib/</location>
|
<location>target/lib/</location>
|
||||||
@ -1217,7 +1302,7 @@
|
|||||||
</sources>
|
</sources>
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping>
|
<mapping>
|
||||||
<directory>/usr/share/elasticsearch/lib/sigar</directory>
|
<directory>${packaging.elasticsearch.home.dir}/lib/sigar</directory>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>
|
||||||
<location>lib/sigar</location>
|
<location>lib/sigar</location>
|
||||||
@ -1229,7 +1314,7 @@
|
|||||||
</sources>
|
</sources>
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping>
|
<mapping>
|
||||||
<directory>/usr/share/elasticsearch/</directory>
|
<directory>${packaging.elasticsearch.home.dir}</directory>
|
||||||
<sources>
|
<sources>
|
||||||
<source>
|
<source>
|
||||||
<location>.</location>
|
<location>.</location>
|
||||||
@ -1241,25 +1326,96 @@
|
|||||||
</source>
|
</source>
|
||||||
</sources>
|
</sources>
|
||||||
</mapping>
|
</mapping>
|
||||||
|
<!-- Add and sets permission on default directories -->
|
||||||
|
<mapping>
|
||||||
|
<directory>${packaging.elasticsearch.data.dir}</directory>
|
||||||
|
<filemode>755</filemode>
|
||||||
|
<username>${packaging.elasticsearch.user}</username>
|
||||||
|
<groupname>${packaging.elasticsearch.group}</groupname>
|
||||||
|
</mapping>
|
||||||
|
<mapping>
|
||||||
|
<directory>${packaging.elasticsearch.log.dir}</directory>
|
||||||
|
<filemode>755</filemode>
|
||||||
|
<username>${packaging.elasticsearch.user}</username>
|
||||||
|
<groupname>${packaging.elasticsearch.group}</groupname>
|
||||||
|
</mapping>
|
||||||
|
<mapping>
|
||||||
|
<directory>${packaging.elasticsearch.work.dir}</directory>
|
||||||
|
<filemode>755</filemode>
|
||||||
|
<username>${packaging.elasticsearch.user}</username>
|
||||||
|
<groupname>${packaging.elasticsearch.group}</groupname>
|
||||||
|
</mapping>
|
||||||
</mappings>
|
</mappings>
|
||||||
<preinstallScriptlet>
|
<preinstallScriptlet>
|
||||||
<scriptFile>src/rpm/scripts/preinstall</scriptFile>
|
<scriptFile>${project.build.directory}/generated-packaging/rpm/scripts/preinstall</scriptFile>
|
||||||
<fileEncoding>utf-8</fileEncoding>
|
<fileEncoding>utf-8</fileEncoding>
|
||||||
</preinstallScriptlet>
|
</preinstallScriptlet>
|
||||||
<postinstallScriptlet>
|
<postinstallScriptlet>
|
||||||
<scriptFile>src/rpm/scripts/postinstall</scriptFile>
|
<scriptFile>${project.build.directory}/generated-packaging/rpm/scripts/postinstall</scriptFile>
|
||||||
<fileEncoding>utf-8</fileEncoding>
|
<fileEncoding>utf-8</fileEncoding>
|
||||||
</postinstallScriptlet>
|
</postinstallScriptlet>
|
||||||
<preremoveScriptlet>
|
<preremoveScriptlet>
|
||||||
<scriptFile>src/rpm/scripts/preremove</scriptFile>
|
<scriptFile>${project.build.directory}/generated-packaging/rpm/scripts/preremove</scriptFile>
|
||||||
<fileEncoding>utf-8</fileEncoding>
|
<fileEncoding>utf-8</fileEncoding>
|
||||||
</preremoveScriptlet>
|
</preremoveScriptlet>
|
||||||
<postremoveScriptlet>
|
<postremoveScriptlet>
|
||||||
<scriptFile>src/rpm/scripts/postremove</scriptFile>
|
<scriptFile>${project.build.directory}/generated-packaging/rpm/scripts/postremove</scriptFile>
|
||||||
<fileEncoding>utf-8</fileEncoding>
|
<fileEncoding>utf-8</fileEncoding>
|
||||||
</postremoveScriptlet>
|
</postremoveScriptlet>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<!-- use packaging.properties when building the .rpm package -->
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-resources-rpm</id>
|
||||||
|
<phase>prepare-package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/generated-packaging/rpm/</outputDirectory>
|
||||||
|
<filters>
|
||||||
|
<filter>src/packaging/common/packaging.properties</filter>
|
||||||
|
<filter>src/packaging/rpm/packaging.properties</filter>
|
||||||
|
</filters>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/packaging/common/</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<includes>
|
||||||
|
<include>**/*</include>
|
||||||
|
</includes>
|
||||||
|
<excludes>
|
||||||
|
<exclude>packaging.properties</exclude>
|
||||||
|
</excludes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/packaging/rpm/</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<includes>
|
||||||
|
<include>**/*</include>
|
||||||
|
</includes>
|
||||||
|
<excludes>
|
||||||
|
<exclude>packaging.properties</exclude>
|
||||||
|
</excludes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.basedir}</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<includes>
|
||||||
|
<include>bin/elasticsearch</include>
|
||||||
|
<include>bin/elasticsearch.in.sh</include>
|
||||||
|
<include>bin/plugin</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>de.thetaphi</groupId>
|
<groupId>de.thetaphi</groupId>
|
||||||
<artifactId>forbiddenapis</artifactId>
|
<artifactId>forbiddenapis</artifactId>
|
||||||
|
11
src/packaging/common/packaging.properties
Normal file
11
src/packaging/common/packaging.properties
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Common properties for building ZIP,GZ,RPM and DEB packages
|
||||||
|
#
|
||||||
|
# Properties defined here can be overridden with specific settings,
|
||||||
|
# like in rpm/packaging.properties and deb/packaging.properties.
|
||||||
|
|
||||||
|
# Default values for min/max heap memory allocated to elasticsearch java process
|
||||||
|
packaging.elasticsearch.heap.min=256m
|
||||||
|
packaging.elasticsearch.heap.max=1g
|
||||||
|
|
||||||
|
# Simple marker to check that properties are correctly overridden
|
||||||
|
packaging.type=tar.gz,gzip
|
@ -15,7 +15,9 @@ case "$1" in
|
|||||||
rm -rf /usr/share/elasticsearch/plugins
|
rm -rf /usr/share/elasticsearch/plugins
|
||||||
|
|
||||||
# Remove **only** empty data dir
|
# Remove **only** empty data dir
|
||||||
rmdir --ignore-fail-on-non-empty /var/lib/elasticsearch
|
if [ -d /var/lib/elasticsearch ]; then
|
||||||
|
rmdir --ignore-fail-on-non-empty /var/lib/elasticsearch
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
purge)
|
purge)
|
5
src/packaging/deb/packaging.properties
Normal file
5
src/packaging/deb/packaging.properties
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Properties used to build to the DEB package
|
||||||
|
#
|
||||||
|
|
||||||
|
# Simple marker to check that properties are correctly overridden
|
||||||
|
packaging.type=deb
|
5
src/packaging/rpm/packaging.properties
Normal file
5
src/packaging/rpm/packaging.properties
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Properties used to build to the RPM package
|
||||||
|
#
|
||||||
|
|
||||||
|
# Simple marker to check that properties are correctly overridden
|
||||||
|
packaging.type=rpm
|
Loading…
x
Reference in New Issue
Block a user