caf-audit-service-container
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>com.github.cafaudit</groupId>
<artifactId>caf-audit-service-container</artifactId>
<version>6.0.0-1420</version>
</dependency><?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015-2026 Open Text.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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>
<groupId>com.github.cafaudit</groupId>
<artifactId>caf-audit-service-container</artifactId>
<name>caf-audit-service-container</name>
<packaging>pom</packaging>
<parent>
<groupId>com.github.cafaudit</groupId>
<artifactId>audit-service-aggregator</artifactId>
<version>6.0.0-1420</version>
</parent>
<dependencies>
<dependency>
<groupId>com.github.cafaudit</groupId>
<artifactId>caf-audit-service-dropwizard</artifactId>
</dependency>
<!-- Testing dependencies -->
<dependency>
<groupId>com.github.cafaudit</groupId>
<artifactId>caf-audit-binding-webservice</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.cafaudit</groupId>
<artifactId>caf-audit-service-testing-auditlog</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.cafaudit</groupId>
<artifactId>caf-audit-service-internal-testing-client</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-lambda</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>integration-test</id>
<activation>
<property>
<name>RE_BUILD_TYPE</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<executions>
<execution>
<id>start-testing-containers</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
<execution>
<id>stop-testing-containers</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>use-default-fixed-ports</id>
<properties>
<webservice.adminport>25080</webservice.adminport>
<webservice.debugport>25085</webservice.debugport>
<webservice.https.adminport>25443</webservice.https.adminport>
<elasticsearch.http.port>9200</elasticsearch.http.port>
</properties>
</profile>
</profiles>
<build>
<plugins>
<!-- Compile test sources. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Run integration tests. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>webservice-Docker</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<argLine>
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
</argLine>
<systemPropertyVariables>
<docker.host.address>${docker.host.address}</docker.host.address>
<webservice.adminport>${webservice.adminport}</webservice.adminport>
<elasticsearch.http.port>${elasticsearch.http.port}</elasticsearch.http.port>
</systemPropertyVariables>
<environmentVariables>
<CAF_ELASTIC_PROTOCOL>http</CAF_ELASTIC_PROTOCOL>
<CAF_ELASTIC_HOST_VALUES>${docker.host.address}</CAF_ELASTIC_HOST_VALUES>
<CAF_ELASTIC_PORT_VALUE>${elasticsearch.http.port}</CAF_ELASTIC_PORT_VALUE>
<webserviceurl>http://${docker.host.address}:${webservice.adminport}/caf-audit-service/v1</webserviceurl>
<webserviceurlhttps>https://${docker.host.address}:${webservice.https.adminport}/caf-audit-service/v1</webserviceurlhttps>
</environmentVariables>
</configuration>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<executions>
<execution>
<id>build-docker-container</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
<execution>
<id>upload-docker-container</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
<configuration>
<filter>audit-service</filter>
</configuration>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<autoPull>on</autoPull>
<logDate>default</logDate>
<watchInterval>500</watchInterval>
<containerNamePattern>%a-%t</containerNamePattern>
<images>
<!--Build image for test keystore-->
<image>
<alias>keystore</alias>
<name>${project.artifactId}-keystore:${project.version}</name>
<build>
<from>${projectDockerRegistry}/cafapi/opensuse-jre21</from>
<runCmds>
<runCmd>mkdir /test-keystore</runCmd>
<runCmd>keytool -genkey -noprompt -alias tomcat -dname "CN=myname, OU=myorganisational.unit, O=myorganisation, L=mycity, S=myprovince, C=GB" -keystore /test-keystore/tomcat.keystore -storepass changeit -keypass changeit -keyalg RSA</runCmd>
<runCmd>keytool -importkeystore -srckeystore /test-keystore/tomcat.keystore -srcstorepass changeit -destkeystore /test-keystore/tomcat.keystore -deststoretype pkcs12</runCmd>
</runCmds>
<volumes>
<volume>/test-keystore</volume>
</volumes>
</build>
</image>
<image>
<alias>audit-service</alias>
<name>${dockerCafAuditOrg}audit-service${dockerProjectVersion}</name>
<build>
<from>${projectDockerRegistry}/cafapi/oraclelinux-jre21</from>
<cmd>
<exec>
<args>/maven/service.sh</args>
</exec>
</cmd>
<healthCheck>
<cmd>curl -f http://localhost:8080/health-check?type=READY || exit 1</cmd>
</healthCheck>
<env>
<CAF_ELASTIC_PROTOCOL>http</CAF_ELASTIC_PROTOCOL>
<CAF_AUDIT_MODE>elasticsearch</CAF_AUDIT_MODE>
<CAF_ELASTIC_HOST_VALUES>elasticsearch</CAF_ELASTIC_HOST_VALUES>
<CAF_ELASTIC_PORT_VALUE>9200</CAF_ELASTIC_PORT_VALUE>
<CAF_ELASTIC_NUMBER_OF_SHARDS>5</CAF_ELASTIC_NUMBER_OF_SHARDS>
<CAF_ELASTIC_NUMBER_OF_REPLICAS>1</CAF_ELASTIC_NUMBER_OF_REPLICAS>
</env>
<assembly>
<mode>tar</mode>
<inline>
<fileSets>
<fileSet>
<fileMode>0755</fileMode>
<includes>
<include>service.sh</include>
</includes>
<lineEnding>unix</lineEnding>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</inline>
</assembly>
</build>
<run>
<ports>
<port>${webservice.debugport}:5005</port>
<port>${webservice.adminport}:8080</port>
<port>${webservice.https.adminport}:8443</port>
</ports>
<env>
<CAF_AUDIT_SERVICE_JAVA_OPTS>
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
</CAF_AUDIT_SERVICE_JAVA_OPTS>
<CAF_LOG_LEVEL>INFO</CAF_LOG_LEVEL>
<DOCKER_HOST>http://172.17.0.1:2375</DOCKER_HOST>
<SSL_KEYSTORE_PATH>/test-keystore</SSL_KEYSTORE_PATH>
<SSL_KEYSTORE>tomcat.keystore</SSL_KEYSTORE>
<SSL_KEYSTORE_PASSWORD>changeit</SSL_KEYSTORE_PASSWORD>
<SSL_CERT_ALIAS>tomcat</SSL_CERT_ALIAS>
<SSL_DISABLE_SNI_HOST_CHECK>true</SSL_DISABLE_SNI_HOST_CHECK>
</env>
<volumes>
<from>
<image>keystore</image>
</from>
</volumes>
<links>
<link>elasticsearch</link>
</links>
<log>
<enabled>true</enabled>
</log>
<wait>
<http>
<url>
http://${docker.host.address}:${webservice.adminport}/health-check?type=READY
</url>
</http>
<time>120000</time>
<shutdown>500</shutdown>
</wait>
</run>
</image>
<!-- elasticsearch image for running integration tests-->
<image>
<alias>elasticsearch</alias>
<name>${projectDockerRegistry}/elasticsearch/elasticsearch-oss</name>
<run>
<hostname>elasticsearch</hostname>
<containerNamePattern>%a-%t</containerNamePattern>
<ports>
<port>${elasticsearch.http.port}:9200</port>
</ports>
<env>
<discovery.type>single-node</discovery.type>
</env>
<wait>
<log>Elasticsearch startup complete</log>
<http>
<url>http://${docker.host.address}:${elasticsearch.http.port}</url>
</http>
<time>300000</time>
<shutdown>500</shutdown>
</wait>
<log>
<enabled>true</enabled>
</log>
</run>
</image>
</images>
</configuration>
</plugin>
</plugins>
</build>
</project>