classification-service-container
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency> <groupId>com.github.cafdataprocessing</groupId> <artifactId>classification-service-container</artifactId> <version>1.2.0-24</version> </dependency>
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2015-2017 Hewlett Packard Enterprise Development LP. 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> <parent> <groupId>com.github.cafdataprocessing</groupId> <artifactId>classification-service-aggregator</artifactId> <version>1.2.0-24</version> </parent> <artifactId>classification-service-container</artifactId> <packaging>pom</packaging> <properties> <classificationservice.policyapi.entrypath>/corepolicy/</classificationservice.policyapi.entrypath> <classificationServiceHost>http://${docker.host.address}:${classificationservice.port}</classificationServiceHost> <classificationservice.url>${classificationServiceHost}/classification/v1</classificationservice.url> <container.classification.service.name>${dockerDataProcessingOrg}classification-service${dockerProjectVersion}</container.classification.service.name> <hibernate.user>postgres</hibernate.user> <hibernate.password>root</hibernate.password> <hibernate.databasename>corepolicy</hibernate.databasename> <!-- Policy API Properties --> <internal.hibernate.connectionstring> jdbc:postgresql://corepolicydb-postgres:5432/<dbname></internal.hibernate.connectionstring> </properties> <profiles> <profile> <id>use-default-fixed-ports</id> <properties> <policyapi.service.port>9100</policyapi.service.port> <postgres.db.port>5432</postgres.db.port> <classificationservice.port>9290</classificationservice.port> </properties> </profile> <!-- profile to optionally disable build of a container, you can enable this profile, and run your tests against a fixed container without rebuilding each time. --> <profile> <id>skip-build-docker-container</id> <build> <plugins> <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <version>${fabric8.docker.maven.version}</version> <executions> <execution> <id>build-docker-container</id> <phase>compile</phase> <goals> <goal>build</goal> </goals> <configuration> <skip>true</skip> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>skip-start-docker-container</id> <build> <plugins> <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <version>${fabric8.docker.maven.version}</version> <executions> <execution> <id>start</id> <phase>pre-integration-test</phase> <goals> <goal>start</goal> </goals> <configuration> <skip>true</skip> </configuration> </execution> <!-- Stop the containers in post-integration-test phase. --> <execution> <id>stop</id> <phase>post-integration-test</phase> <goals> <goal>stop</goal> </goals> <configuration> <skip>true</skip> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> <dependencies> <!-- only needed for db installer container for testing --> <dependency> <groupId>com.github.cafdataprocessing</groupId> <artifactId>corepolicy-database</artifactId> <version>${caf.corepolicy.version}</version> </dependency> <dependency> <groupId>com.github.cafdataprocessing</groupId> <artifactId>classification-service-client</artifactId> <version>${project.version}</version> <scope>test</scope> <type>jar</type> </dependency> <dependency> <groupId>com.github.cafdataprocessing</groupId> <artifactId>classification-service-creation-util</artifactId> <version>${project.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>${maven.compiler.version}</version> <executions> <execution> <phase>test-compile</phase> <goals> <goal>testCompile</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>${maven.resources.version}</version> <executions> <execution> <phase>process-test-resources</phase> <goals> <goal>testResources</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-failsafe-plugin</artifactId> <version>${maven.failsafe.version}</version> <configuration> <!-- use debugForkedProcess to enable debugging of tests during a run --> <!--<debugForkedProcess>true</debugForkedProcess>--> <systemPropertyVariables> <classificationservice.port>${classificationservice.port}</classificationservice.port> </systemPropertyVariables> <environmentVariables> <classification.webservice.host>${classificationServiceHost}</classification.webservice.host> </environmentVariables> </configuration> </plugin> <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <version>${fabric8.docker.maven.version}</version> <executions> <!-- Build the container in compile phase. --> <execution> <id>build-docker-container</id> <phase>compile</phase> <goals> <goal>build</goal> </goals> </execution> <!-- Start the containers in pre-integration-test phase. --> <execution> <id>start</id> <phase>pre-integration-test</phase> <goals> <goal>start</goal> </goals> </execution> <!-- Stop the containers in post-integration-test phase. --> <execution> <id>stop</id> <phase>post-integration-test</phase> <goals> <goal>stop</goal> </goals> </execution> <!-- Push the docker image for the worker in deploy phase --> <execution> <id>upload-docker-container</id> <phase>deploy</phase> <goals> <goal>push</goal> </goals> <configuration> <filter>classification-service</filter> </configuration> </execution> </executions> <configuration> <verbose>true</verbose> <autoPull>true</autoPull> <useColor>true</useColor> <images> <!-- Start of Policy API Containers, to allow health check to pass on classification-service --> <!-- PostGres Database for Policy API --> <image> <alias>corepolicydb-postgres</alias> <name>postgres:9.4</name> <run> <ports> <port>${postgres.db.port}:5432</port> </ports> <env> <POSTGRES_DB>${hibernate.databasename}</POSTGRES_DB> <POSTGRES_PASSWORD>${hibernate.password}</POSTGRES_PASSWORD> <POSTGRES_USER>${hibernate.user}</POSTGRES_USER> </env> <wait> <log>PostgreSQL init process complete</log> <time>20000</time> <shutdown>500</shutdown> </wait> <log> <enabled>true</enabled> </log> </run> </image> <!-- Installs policy database to PostGres Container --> <image> <alias>corepolicy-dbinstaller</alias> <name>policy/dbinstaller</name> <build> <from>java:8</from> <tags> <tag>temporary-item-please-remove</tag> </tags> <assembly> <basedir>/</basedir> <inline> <dependencySets> <dependencySet> <fileMode>0755</fileMode> <useProjectArtifact>true</useProjectArtifact> <includes> <include>com.github.cafdataprocessing:corepolicy-database </include> </includes> <outputFileNameMapping>corepolicy-database.jar </outputFileNameMapping> </dependencySet> </dependencySets> </inline> </assembly> </build> <run> <links> <link>corepolicydb-postgres</link> </links> <log> <enabled>true</enabled> </log> <cmd>java -Dapi.mode=direct -Dapi.direct.repository=hibernate -Dhibernate.connectionstring=${internal.hibernate.connectionstring} -Dhibernate.user=${hibernate.user} -Dhibernate.password=${hibernate.password} -Dhibernate.databasename=${hibernate.databasename} -jar /corepolicy-database.jar -c </cmd> <wait> <log>DB update finished.</log> <time>120000</time> <shutdown>500</shutdown> </wait> </run> </image> <!-- Policy API Container --> <image> <alias>policy-admin</alias> <name>${container.policy.admin.name}</name> <run> <hostname>policyadmin</hostname> <ports> <!-- Expose port for tomcat --> <port>${policyapi.service.port}:8080</port> </ports> <env> <api.direct.repository>hibernate</api.direct.repository> <api.mode>direct</api.mode> <engine.environmentcache.verifyperiod>PT0S</engine.environmentcache.verifyperiod> <hibernate.connectionstring>${internal.hibernate.connectionstring} </hibernate.connectionstring> <hibernate.databasename>${hibernate.databasename}</hibernate.databasename> <hibernate.password>${hibernate.password}</hibernate.password> <hibernate.user>${hibernate.user}</hibernate.user> </env> <wait> <http> <!-- note health check uses external port exposed on docker VM, it may be in bridged mode, or running in its own machine, in which case, this can be the same as the container.run.tomcat.service.port --> <url> http://${docker.host.address}:${policyapi.service.port}/corepolicy/healthcheck?project_id=1 </url> <method>GET</method> </http> <time>240000</time> <shutdown>500</shutdown> </wait> <links> <link>corepolicydb-postgres</link> </links> <log> <!-- enable logs from the container, they will show with policyadmin> prefix and in the colour yellow --> <color>yellow</color> <enabled>true</enabled> </log> </run> </image> <!-- End of Policy API Containers --> <image> <alias>classification-service</alias> <name>${container.classification.service.name}</name> <build> <from>node:4.4.7</from> <labels> <Build.Number>${project.version}</Build.Number> <Build.Date>${maven.build.timestamp}</Build.Date> <Git.Branch>${git.branch}</Git.Branch> <Git.Commit>${git.revision}</Git.Commit> </labels> <optimise>true</optimise> <ports> <port>8080</port> </ports> <env> <NODE_ENV>production</NODE_ENV> </env> <!-- Copy the application folder into the container (without any existing installed module or test files --> <assembly> <inline> <fileSets> <fileSet> <directory>${project.basedir}/../classification-service-core</directory> <outputDirectory>/classification-service</outputDirectory> <excludes> <exclude>node_modules/**</exclude> <exclude>test/**</exclude> </excludes> </fileSet> </fileSets> </inline> </assembly> <workdir>/maven/classification-service</workdir> <runCmds> <runCmd> http_proxy=${env.HTTP_PROXY} \ https_proxy=${env.HTTPS_PROXY} \ npm install </runCmd> </runCmds> <cmd>node app.js</cmd> </build> <run> <ports> <port>${classificationservice.port}:8080</port> </ports> <env> <CAF_CLASSIFICATION_SERVICE_PORT>8080</CAF_CLASSIFICATION_SERVICE_PORT> <CAF_CLASSIFICATION_SERVICE_POLICY_API_HOST>policy-admin </CAF_CLASSIFICATION_SERVICE_POLICY_API_HOST> <CAF_CLASSIFICATION_SERVICE_POLICY_API_PORT>8080</CAF_CLASSIFICATION_SERVICE_POLICY_API_PORT> <CAF_CLASSIFICATION_SERVICE_POLICY_API_ENTRYPATH> ${classificationservice.policyapi.entrypath} </CAF_CLASSIFICATION_SERVICE_POLICY_API_ENTRYPATH> <CAF_LOG_LEVEL>WARNING</CAF_LOG_LEVEL> </env> <wait> <http> <url>${classificationservice.url}/healthcheck</url> <method>GET</method> </http> <time>40000</time> <shutdown>500</shutdown> </wait> <links> <link>policy-admin</link> </links> <log> <enabled>true</enabled> </log> </run> </image> </images> </configuration> </plugin> </plugins> </build> </project>