Build: Split packages into submodules
This change creates a proper `distribution` modules in which we have today packaging for all of our four current packages: * zip * tar.gz * rpm * deb Licenes have moved into the distribution project as well. So have the config/ and the bin/ directory from the core/ project. The RPM package is now built, if rpmbuild exists. The bats tests have been moved as well. Also the zip distribution now executes the REST integration tests.
This commit is contained in:
parent
01ae730023
commit
9628d2632f
|
@ -318,4 +318,6 @@ environment before the tests are executed:
|
|||
ES_CLEAN_BEFORE_TEST=true bats 30_deb_package.bats
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
|
||||
The current mode of execution is to copy all the packages that should be tested
|
||||
into one directory, then copy the bats files into the same directory and run
|
||||
those.
|
||||
|
|
624
core/pom.xml
624
core/pom.xml
|
@ -18,24 +18,9 @@
|
|||
|
||||
|
||||
<properties>
|
||||
<!-- Properties used for building RPM & DEB packages (see common/packaging.properties) -->
|
||||
<packaging.elasticsearch.home.dir>/usr/share/elasticsearch</packaging.elasticsearch.home.dir>
|
||||
<packaging.elasticsearch.bin.dir>/usr/share/elasticsearch/bin</packaging.elasticsearch.bin.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.log.dir>/var/log/elasticsearch</packaging.elasticsearch.log.dir>
|
||||
<packaging.elasticsearch.plugins.dir>${packaging.elasticsearch.home.dir}/plugins</packaging.elasticsearch.plugins.dir>
|
||||
<packaging.elasticsearch.pid.dir>/var/run/elasticsearch</packaging.elasticsearch.pid.dir>
|
||||
<packaging.elasticsearch.systemd.dir>/usr/lib/systemd/system</packaging.elasticsearch.systemd.dir>
|
||||
<packaging.elasticsearch.systemd.sysctl.dir>/usr/lib/sysctl.d</packaging.elasticsearch.systemd.sysctl.dir>
|
||||
<packaging.elasticsearch.tmpfilesd.dir>/usr/lib/tmpfiles.d</packaging.elasticsearch.tmpfilesd.dir>
|
||||
<deb.sign>false</deb.sign>
|
||||
<deb.sign.method>dpkg-sig</deb.sign.method>
|
||||
<skip.integ.tests>true</skip.integ.tests>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
|
@ -230,12 +215,6 @@
|
|||
|
||||
<build>
|
||||
|
||||
<!-- This file contains all the common properties used to build
|
||||
the different packages (tar.gz, deb, rpm) using Maven resources plugin -->
|
||||
<filters>
|
||||
<filter>${project.basedir}/src/packaging/common/packaging.properties</filter>
|
||||
</filters>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/java</directory>
|
||||
|
@ -431,532 +410,6 @@
|
|||
</filters>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resources</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/bin</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}/bin</directory>
|
||||
<filtering>true</filtering>
|
||||
<excludes>
|
||||
<exclude>*.exe</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.basedir}/bin</directory>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>*.exe</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<!-- Filters some files and uses packaging.properties when building the .deb package -->
|
||||
<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>${project.basedir}/src/packaging/common/packaging.properties</filter>
|
||||
<filter>${project.basedir}/src/packaging/deb/packaging.properties</filter>
|
||||
</filters>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/packaging/common/</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>packaging.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.basedir}/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>
|
||||
<!-- Filters some files and uses packaging.properties when building the .rpm package -->
|
||||
<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>${project.basedir}/src/packaging/common/packaging.properties</filter>
|
||||
<filter>${project.basedir}/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>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<outputDirectory>${project.build.directory}/releases/</outputDirectory>
|
||||
<descriptors>
|
||||
<descriptor>${project.basedir}/src/main/assemblies/targz-bin.xml</descriptor>
|
||||
<descriptor>${project.basedir}/src/main/assemblies/zip-bin.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||
<includeScope>runtime</includeScope>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Deb Packaging -->
|
||||
<plugin>
|
||||
<!-- some infos https://github.com/tcurdt/jdeb/blob/master/docs/maven.md -->
|
||||
<artifactId>jdeb</artifactId>
|
||||
<groupId>org.vafer</groupId>
|
||||
<version>1.4</version>
|
||||
<configuration>
|
||||
<deb>${project.build.directory}/releases/${project.artifactId}-${project.version}.deb</deb>
|
||||
<controlDir>${project.build.directory}/generated-packaging/deb/scripts</controlDir>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jdeb</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<signPackage>${deb.sign}</signPackage>
|
||||
<keyring>${gpg.keyring}</keyring>
|
||||
<key>${gpg.key}</key>
|
||||
<passphrase>${gpg.passphrase}</passphrase>
|
||||
<signMethod>${deb.sign.method}</signMethod>
|
||||
<dataSet>
|
||||
<!-- Add bin directory -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/bin</src>
|
||||
<type>directory</type>
|
||||
<includes>elasticsearch,elasticsearch.in.sh,plugin</includes>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>${packaging.elasticsearch.bin.dir}</prefix>
|
||||
<filemode>755</filemode>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Add configuration files -->
|
||||
<data>
|
||||
<src>${project.basedir}/config</src>
|
||||
<type>directory</type>
|
||||
<excludes>.DS_Store</excludes>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>${packaging.elasticsearch.conf.dir}</prefix>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Add environment vars file -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/env/elasticsearch</src>
|
||||
<type>file</type>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>/etc/default</prefix>
|
||||
<filemode>644</filemode>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Add libs -->
|
||||
<data>
|
||||
<src>${project.build.directory}/</src>
|
||||
<includes>${project.build.finalName}.jar</includes>
|
||||
<type>directory</type>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>${packaging.elasticsearch.home.dir}/lib</prefix>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<data>
|
||||
<src>${project.build.directory}/lib</src>
|
||||
<excludes>${project.build.finalName}-shaded.jar,${project.build.finalName}-sources.jar,${project.build.finalName}-tests.jar,${project.build.finalName}-test-sources.jar,slf4j-api-*.jar</excludes>
|
||||
<type>directory</type>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>${packaging.elasticsearch.home.dir}/lib</prefix>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Add init.d files -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/init.d/</src>
|
||||
<type>directory</type>
|
||||
<excludes>.DS_Store</excludes>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>/etc/init.d</prefix>
|
||||
<filemode>755</filemode>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Adds systemd file -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/systemd/elasticsearch.service</src>
|
||||
<dst>${packaging.elasticsearch.systemd.dir}/elasticsearch.service</dst>
|
||||
<type>file</type>
|
||||
</data>
|
||||
<!-- Adds systemd/sysctl.d configuration file -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/systemd/sysctl/elasticsearch.conf</src>
|
||||
<dst>${packaging.elasticsearch.systemd.sysctl.dir}/elasticsearch.conf</dst>
|
||||
<type>file</type>
|
||||
</data>
|
||||
<!-- Adds systemd/tmpfiles.d configuration file -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/systemd/elasticsearch.conf</src>
|
||||
<dst>${packaging.elasticsearch.tmpfilesd.dir}/elasticsearch.conf</dst>
|
||||
<type>file</type>
|
||||
</data>
|
||||
<!-- Add lintian files -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/lintian</src>
|
||||
<type>directory</type>
|
||||
<excludes>.DS_Store</excludes>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>/usr/share/lintian/overrides</prefix>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Add readme files -->
|
||||
<data>
|
||||
<src>${project.basedir}/</src>
|
||||
<includes>*.txt, *.textile</includes>
|
||||
<excludes>LICENSE.txt, .DS_Store</excludes>
|
||||
<type>directory</type>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>${packaging.elasticsearch.home.dir}</prefix>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Add license files -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/copyright</src>
|
||||
<dst>/usr/share/doc/elasticsearch/copyright</dst>
|
||||
<type>file</type>
|
||||
</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.plugins.dir}</path>
|
||||
<path>${packaging.elasticsearch.pid.dir}</path>
|
||||
</paths>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<dirmode>755</dirmode>
|
||||
<user>${packaging.elasticsearch.user}</user>
|
||||
<group>${packaging.elasticsearch.group}</group>
|
||||
</mapper>
|
||||
</data>
|
||||
</dataSet>
|
||||
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Rpm Packaging -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>rpm-maven-plugin</artifactId>
|
||||
<version>2.1.3</version>
|
||||
<configuration>
|
||||
<distribution>Elasticsearch</distribution>
|
||||
<group>Application/Internet</group>
|
||||
<packager>Elasticsearch</packager>
|
||||
<prefix>/usr</prefix>
|
||||
<changelogFile>src/changelog</changelogFile>
|
||||
<defineStatements>
|
||||
<defineStatement>_unpackaged_files_terminate_build 0</defineStatement>
|
||||
<defineStatement>_binaries_in_noarch_packages_terminate_build 0</defineStatement>
|
||||
</defineStatements>
|
||||
<defaultFilemode>644</defaultFilemode>
|
||||
<defaultDirmode>755</defaultDirmode>
|
||||
<defaultUsername>root</defaultUsername>
|
||||
<defaultGroupname>root</defaultGroupname>
|
||||
<mappings>
|
||||
<!-- Add bin directory -->
|
||||
<mapping>
|
||||
<directory>${packaging.elasticsearch.bin.dir}/</directory>
|
||||
<filemode>755</filemode>
|
||||
<sources>
|
||||
<source>
|
||||
<location>${project.build.directory}/generated-packaging/rpm/bin</location>
|
||||
<includes>
|
||||
<include>elasticsearch</include>
|
||||
<include>elasticsearch.in.sh</include>
|
||||
<include>plugin</include>
|
||||
</includes>
|
||||
</source>
|
||||
</sources>
|
||||
</mapping>
|
||||
<!-- Add configuration files -->
|
||||
<mapping>
|
||||
<directory>${packaging.elasticsearch.conf.dir}/</directory>
|
||||
<configuration>noreplace</configuration>
|
||||
<sources>
|
||||
<source>
|
||||
<location>${project.basedir}/config/</location>
|
||||
<includes>
|
||||
<include>*.yml</include>
|
||||
</includes>
|
||||
</source>
|
||||
</sources>
|
||||
</mapping>
|
||||
<!-- Add environment vars file -->
|
||||
<mapping>
|
||||
<directory>/etc/sysconfig/</directory>
|
||||
<directoryIncluded>false</directoryIncluded>
|
||||
<configuration>noreplace</configuration>
|
||||
<sources>
|
||||
<source>
|
||||
<location>${project.build.directory}/generated-packaging/rpm/env/</location>
|
||||
<includes>
|
||||
<include>elasticsearch</include>
|
||||
</includes>
|
||||
</source>
|
||||
</sources>
|
||||
</mapping>
|
||||
<!-- Add libs -->
|
||||
<mapping>
|
||||
<directory>${packaging.elasticsearch.home.dir}/lib</directory>
|
||||
<sources>
|
||||
<source>
|
||||
<location>target/lib/</location>
|
||||
<excludes>
|
||||
<exclude>${project.build.finalName}-shaded.jar</exclude>
|
||||
<exclude>${project.build.finalName}-sources.jar</exclude>
|
||||
<exclude>${project.build.finalName}-tests.jar</exclude>
|
||||
<exclude>${project.build.finalName}-test-sources.jar</exclude>
|
||||
<exclude>slf4j-api-*.jar</exclude>
|
||||
</excludes>
|
||||
</source>
|
||||
<source>
|
||||
<location>${project.build.directory}/</location>
|
||||
<includes>
|
||||
<include>${project.build.finalName}.jar</include>
|
||||
</includes>
|
||||
</source>
|
||||
</sources>
|
||||
</mapping>
|
||||
<!-- Add init.d files -->
|
||||
<mapping>
|
||||
<directory>/etc/init.d</directory>
|
||||
<directoryIncluded>false</directoryIncluded>
|
||||
<filemode>755</filemode>
|
||||
<configuration>true</configuration>
|
||||
<sources>
|
||||
<source>
|
||||
<location>${project.build.directory}/generated-packaging/rpm/init.d</location>
|
||||
<includes>
|
||||
<include>elasticsearch</include>
|
||||
</includes>
|
||||
</source>
|
||||
</sources>
|
||||
</mapping>
|
||||
<!-- Adds systemd file -->
|
||||
<mapping>
|
||||
<directory>${packaging.elasticsearch.systemd.dir}</directory>
|
||||
<directoryIncluded>false</directoryIncluded>
|
||||
<configuration>true</configuration>
|
||||
<sources>
|
||||
<source>
|
||||
<location>${project.build.directory}/generated-packaging/rpm/systemd</location>
|
||||
<includes>
|
||||
<include>elasticsearch.service</include>
|
||||
</includes>
|
||||
</source>
|
||||
</sources>
|
||||
</mapping>
|
||||
<!-- Adds systemd/sysctl.d configuration file -->
|
||||
<mapping>
|
||||
<directory>${packaging.elasticsearch.systemd.sysctl.dir}</directory>
|
||||
<configuration>true</configuration>
|
||||
<sources>
|
||||
<source>
|
||||
<location>${project.build.directory}/generated-packaging/rpm/systemd/sysctl</location>
|
||||
<includes>
|
||||
<include>elasticsearch.conf</include>
|
||||
</includes>
|
||||
</source>
|
||||
</sources>
|
||||
</mapping>
|
||||
<!-- Adds systemd/tmpfiles.d configuration file -->
|
||||
<mapping>
|
||||
<directory>${packaging.elasticsearch.tmpfilesd.dir}</directory>
|
||||
<configuration>true</configuration>
|
||||
<sources>
|
||||
<source>
|
||||
<location>${project.build.directory}/generated-packaging/rpm/systemd/</location>
|
||||
<includes>
|
||||
<include>elasticsearch.conf</include>
|
||||
</includes>
|
||||
</source>
|
||||
</sources>
|
||||
</mapping>
|
||||
<!-- Add readme files -->
|
||||
<mapping>
|
||||
<directory>${packaging.elasticsearch.home.dir}</directory>
|
||||
<sources>
|
||||
<source>
|
||||
<location>.</location>
|
||||
<includes>
|
||||
<include>LICENSE.txt</include>
|
||||
<include>NOTICE.txt</include>
|
||||
<include>README.textile</include>
|
||||
</includes>
|
||||
</source>
|
||||
</sources>
|
||||
</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.plugins.dir}</directory>
|
||||
<filemode>755</filemode>
|
||||
<username>${packaging.elasticsearch.user}</username>
|
||||
<groupname>${packaging.elasticsearch.group}</groupname>
|
||||
</mapping>
|
||||
<mapping>
|
||||
<directory>${packaging.elasticsearch.pid.dir}</directory>
|
||||
<filemode>755</filemode>
|
||||
<username>${packaging.elasticsearch.user}</username>
|
||||
<groupname>${packaging.elasticsearch.group}</groupname>
|
||||
</mapping>
|
||||
</mappings>
|
||||
<preinstallScriptlet>
|
||||
<scriptFile>${project.build.directory}/generated-packaging/rpm/scripts/preinst</scriptFile>
|
||||
<fileEncoding>utf-8</fileEncoding>
|
||||
</preinstallScriptlet>
|
||||
<postinstallScriptlet>
|
||||
<scriptFile>${project.build.directory}/generated-packaging/rpm/scripts/postinst</scriptFile>
|
||||
<fileEncoding>utf-8</fileEncoding>
|
||||
</postinstallScriptlet>
|
||||
<preremoveScriptlet>
|
||||
<scriptFile>${project.build.directory}/generated-packaging/rpm/scripts/prerm</scriptFile>
|
||||
<fileEncoding>utf-8</fileEncoding>
|
||||
</preremoveScriptlet>
|
||||
<postremoveScriptlet>
|
||||
<scriptFile>${project.build.directory}/generated-packaging/rpm/scripts/postrm</scriptFile>
|
||||
<fileEncoding>utf-8</fileEncoding>
|
||||
</postremoveScriptlet>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@ -1003,32 +456,6 @@
|
|||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
<!-- start up external cluster -->
|
||||
<execution>
|
||||
<id>integ-setup</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster"/>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
<!-- shut down external cluster -->
|
||||
<execution>
|
||||
<id>integ-teardown</id>
|
||||
<phase>post-integration-test</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<ant antfile="${elasticsearch.integ.antfile}" target="stop-external-cluster"/>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -1074,54 +501,5 @@
|
|||
</activation>
|
||||
<!-- not including license-maven-plugin is sufficent to expose default license -->
|
||||
</profile>
|
||||
<profile>
|
||||
<id>release</id> <!-- named after the parents release profile to be activated -->
|
||||
<activation>
|
||||
<property>
|
||||
<name>package.rpm</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>rpm-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-rpm</id>
|
||||
<goals>
|
||||
<goal>attached-rpm</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>sign-rpm</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>rpm.sign</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>rpm-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<keyname>${gpg.key}</keyname>
|
||||
<keypath>${gpg.keyring}</keypath>
|
||||
<keyPassphrase>
|
||||
<passphrase>${gpg.passphrase}</passphrase>
|
||||
</keyPassphrase>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,280 @@
|
|||
<?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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.elasticsearch.distribution</groupId>
|
||||
<artifactId>elasticsearch-distribution</artifactId>
|
||||
<version>2.0.0-beta1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>elasticsearch-deb</artifactId>
|
||||
<packaging>deb</packaging>
|
||||
<name>Elasticsearch DEB Distribution</name>
|
||||
|
||||
<properties>
|
||||
<skip.integ.tests>true</skip.integ.tests>
|
||||
<deb.sign>false</deb.sign>
|
||||
<deb.sign.method>dpkg-sig</deb.sign.method>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
|
||||
<filters>
|
||||
<filter>${project.basedir}/src/main/packaging/packaging.properties</filter>
|
||||
</filters>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<!-- Filters some files and uses packaging.properties when building the .deb package -->
|
||||
<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>${project.basedir}/../src/main/packaging/packaging.properties</filter>
|
||||
<filter>${project.basedir}/src/main/packaging/packaging.properties</filter>
|
||||
</filters>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}/../src/main/packaging/</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>packaging.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/packaging/</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>packaging.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.basedir}/../src/main/resources</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>
|
||||
<!-- some infos https://github.com/tcurdt/jdeb/blob/master/docs/maven.md -->
|
||||
<artifactId>jdeb</artifactId>
|
||||
<groupId>org.vafer</groupId>
|
||||
<version>1.4</version>
|
||||
<configuration>
|
||||
<!-- By default it should generates target/${artifactId}_${version}.deb but we get elasticsearch_2.0.0~SNAPSHOT_all.deb -->
|
||||
<deb>${project.build.directory}/releases/elasticsearch-${project.version}.deb</deb>
|
||||
<controlDir>${project.build.directory}/generated-packaging/deb/scripts</controlDir>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jdeb</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<signPackage>${deb.sign}</signPackage>
|
||||
<keyring>${gpg.keyring}</keyring>
|
||||
<key>${gpg.key}</key>
|
||||
<passphrase>${gpg.passphrase}</passphrase>
|
||||
<signMethod>${deb.sign.method}</signMethod>
|
||||
<dataSet>
|
||||
<!-- Add bin directory -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/bin</src>
|
||||
<type>directory</type>
|
||||
<includes>elasticsearch,elasticsearch.in.sh,plugin</includes>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>${packaging.elasticsearch.bin.dir}</prefix>
|
||||
<filemode>755</filemode>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Add configuration files -->
|
||||
<data>
|
||||
<src>${project.basedir}/../src/main/resources/config</src>
|
||||
<type>directory</type>
|
||||
<excludes>.DS_Store</excludes>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>${packaging.elasticsearch.conf.dir}</prefix>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Add environment vars file -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/env/elasticsearch</src>
|
||||
<type>file</type>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>/etc/default</prefix>
|
||||
<filemode>644</filemode>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Add libs -->
|
||||
<data>
|
||||
<src>${project.build.directory}/</src>
|
||||
<includes>elasticsearch-${project.version}.jar</includes>
|
||||
<type>directory</type>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>${packaging.elasticsearch.home.dir}/lib</prefix>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<data>
|
||||
<src>${project.build.directory}/../target/lib</src>
|
||||
<excludes>${project.build.finalName}-shaded.jar,${project.build.finalName}-sources.jar,${project.build.finalName}-tests.jar,${project.build.finalName}-test-sources.jar,slf4j-api-*.jar</excludes>
|
||||
<type>directory</type>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>${packaging.elasticsearch.home.dir}/lib</prefix>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Add init.d files -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/init.d/</src>
|
||||
<type>directory</type>
|
||||
<excludes>.DS_Store</excludes>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>/etc/init.d</prefix>
|
||||
<filemode>755</filemode>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Adds systemd file -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/systemd/elasticsearch.service</src>
|
||||
<dst>${packaging.elasticsearch.systemd.dir}/elasticsearch.service</dst>
|
||||
<type>file</type>
|
||||
</data>
|
||||
<!-- Adds systemd/sysctl.d configuration file -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/systemd/sysctl/elasticsearch.conf</src>
|
||||
<dst>${packaging.elasticsearch.systemd.sysctl.dir}/elasticsearch.conf</dst>
|
||||
<type>file</type>
|
||||
</data>
|
||||
<!-- Adds systemd/tmpfiles.d configuration file -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/systemd/elasticsearch.conf</src>
|
||||
<dst>${packaging.elasticsearch.tmpfilesd.dir}/elasticsearch.conf</dst>
|
||||
<type>file</type>
|
||||
</data>
|
||||
<!-- Add lintian files -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/lintian</src>
|
||||
<type>directory</type>
|
||||
<excludes>.DS_Store</excludes>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>/usr/share/lintian/overrides</prefix>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Add readme files -->
|
||||
<data>
|
||||
<src>${project.basedir}/../src/main/resources/</src>
|
||||
<includes>*.txt, *.textile</includes>
|
||||
<excludes>LICENSE.txt, .DS_Store</excludes>
|
||||
<type>directory</type>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<prefix>${packaging.elasticsearch.home.dir}</prefix>
|
||||
<user>root</user>
|
||||
<group>root</group>
|
||||
</mapper>
|
||||
</data>
|
||||
<!-- Add license files -->
|
||||
<data>
|
||||
<src>${project.build.directory}/generated-packaging/deb/copyright</src>
|
||||
<dst>/usr/share/doc/elasticsearch/copyright</dst>
|
||||
<type>file</type>
|
||||
</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.plugins.dir}</path>
|
||||
<path>${packaging.elasticsearch.pid.dir}</path>
|
||||
</paths>
|
||||
<mapper>
|
||||
<type>perm</type>
|
||||
<dirmode>755</dirmode>
|
||||
<user>${packaging.elasticsearch.user}</user>
|
||||
<group>${packaging.elasticsearch.group}</group>
|
||||
</mapper>
|
||||
</data>
|
||||
</dataSet>
|
||||
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>check-license</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<condition property="licenses.exists">
|
||||
<available file="${basedir}/../licenses" type="dir"/>
|
||||
</condition>
|
||||
<echo taskName="license check">Running license check</echo>
|
||||
<!-- on windows checksums are calculated wrong -->
|
||||
<exec failonerror="${licenses.exists}" executable="perl" dir="${elasticsearch.tools.directory}/license-check" osfamily="unix" >
|
||||
<arg value="check_license_and_sha.pl"/>
|
||||
<arg value="--check"/>
|
||||
<arg value="${basedir}/../licenses"/>
|
||||
<arg value="${basedir}/target/releases/${project.build.finalName}.deb"/>
|
||||
</exec>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -173,7 +173,7 @@ case "$1" in
|
|||
fi
|
||||
|
||||
# Start Daemon
|
||||
start-stop-daemon --start -b --user "$ES_USER" -c "$ES_USER" --pidfile "$PID_FILE" --exec $DAEMON -- $DAEMON_OPTS
|
||||
start-stop-daemon -d $ES_HOME --start -b --user "$ES_USER" -c "$ES_USER" --pidfile "$PID_FILE" --exec $DAEMON -- $DAEMON_OPTS
|
||||
return=$?
|
||||
if [ $return -eq 0 ]
|
||||
then
|
|
@ -1,5 +1,5 @@
|
|||
=============================================================================
|
||||
= NOTICE file corresponding to section 4d of the Apache License Version 2.0 =
|
||||
=============================================================================
|
||||
This product includes software developed by
|
||||
Joda.org (http://www.joda.org/).
|
||||
=============================================================================
|
||||
= NOTICE file corresponding to section 4d of the Apache License Version 2.0 =
|
||||
=============================================================================
|
||||
This product includes software developed by
|
||||
Joda.org (http://www.joda.org/).
|
|
@ -1,5 +1,5 @@
|
|||
=============================================================================
|
||||
= NOTICE file corresponding to section 4d of the Apache License Version 2.0 =
|
||||
=============================================================================
|
||||
This product includes software developed by
|
||||
Joda.org (http://www.joda.org/).
|
||||
=============================================================================
|
||||
= NOTICE file corresponding to section 4d of the Apache License Version 2.0 =
|
||||
=============================================================================
|
||||
This product includes software developed by
|
||||
Joda.org (http://www.joda.org/).
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue