From ab1824d122b50d29e000bb58521d8dace9cba2b6 Mon Sep 17 00:00:00 2001 From: Michael Mokry Date: Wed, 13 Feb 2019 10:34:48 -0600 Subject: Package and Create Docker Image for Xacml PDP - Creates docker image of policy xacml-pdp - Creates zip package of policy xacml-pdp - Also committed changes from Healthcheck/Statitics review that were allowed to be deferred Change-Id: Ia5fb72be05a30a341692453fe4ff32c7b112e861 Issue-ID: POLICY-1436 Signed-off-by: Michael Mokry --- .../pdpx/main/rest/XacmlPdpRestController.java | 8 +- .../policy/pdpx/main/rest/XacmlPdpRestServer.java | 2 +- .../org/onap/policy/pdpx/main/startstop/Main.java | 14 +- .../pdpx/main/rest/TestXacmlPdpRestServer.java | 51 +++--- .../pdpx/main/rest/TestXacmlPdpStatistics.java | 64 ++++---- .../onap/policy/pdpx/main/startstop/TestMain.java | 9 +- packages/policy-xacmlpdp-docker/pom.xml | 176 +++++++++++++++++++++ .../src/main/docker/Dockerfile | 46 ++++++ .../src/main/docker/policy-pdpx.sh | 43 +++++ packages/policy-xacmlpdp-tarball/pom.xml | 65 ++++++++ .../src/main/package/tarball/assembly.xml | 70 ++++++++ .../src/main/resources/etc/defaultConfig.json | 11 ++ .../src/main/resources/etc/logback.xml | 163 +++++++++++++++++++ .../src/main/resources/etc/s3pConfig.json | 11 ++ .../src/main/resources/etc/ssl/policy-keystore | Bin 0 -> 4311 bytes .../src/main/resources/etc/ssl/policy-truststore | Bin 0 -> 124180 bytes packages/pom.xml | 54 +++++++ pom.xml | 4 +- 18 files changed, 729 insertions(+), 62 deletions(-) create mode 100644 packages/policy-xacmlpdp-docker/pom.xml create mode 100644 packages/policy-xacmlpdp-docker/src/main/docker/Dockerfile create mode 100644 packages/policy-xacmlpdp-docker/src/main/docker/policy-pdpx.sh create mode 100644 packages/policy-xacmlpdp-tarball/pom.xml create mode 100644 packages/policy-xacmlpdp-tarball/src/main/package/tarball/assembly.xml create mode 100644 packages/policy-xacmlpdp-tarball/src/main/resources/etc/defaultConfig.json create mode 100644 packages/policy-xacmlpdp-tarball/src/main/resources/etc/logback.xml create mode 100644 packages/policy-xacmlpdp-tarball/src/main/resources/etc/s3pConfig.json create mode 100644 packages/policy-xacmlpdp-tarball/src/main/resources/etc/ssl/policy-keystore create mode 100644 packages/policy-xacmlpdp-tarball/src/main/resources/etc/ssl/policy-truststore create mode 100644 packages/pom.xml diff --git a/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestController.java b/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestController.java index ae950fda..b061c96d 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestController.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestController.java @@ -49,20 +49,16 @@ public class XacmlPdpRestController { @GET @Path("healthcheck") - @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Perform a system healthcheck", - notes = "Provides healthy status of the Policy Xacml PDP component", - response = HealthCheckReport.class) + notes = "Provides healthy status of the Policy Xacml PDP component", response = HealthCheckReport.class) public Response healthcheck() { return Response.status(Response.Status.OK).entity(new HealthCheckProvider().performHealthCheck()).build(); } @GET @Path("statistics") - @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Fetch current statistics", - notes = "Provides current statistics of the Policy Xacml PDP component", - response = StatisticsReport.class) + notes = "Provides current statistics of the Policy Xacml PDP component", response = StatisticsReport.class) public Response statistics() { return Response.status(Response.Status.OK).entity(new StatisticsProvider().fetchCurrentStatistics()).build(); } diff --git a/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestServer.java b/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestServer.java index 3a3992fc..90f0bfa1 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestServer.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestServer.java @@ -99,7 +99,7 @@ public class XacmlPdpRestServer implements Startable { public boolean stop() { for (final HttpServletServer server : servers) { try { - server.stop(); + server.shutdown(); } catch (final Exception exp) { LOGGER.error("Failed to stop xacml pdp http server", exp); } diff --git a/main/src/main/java/org/onap/policy/pdpx/main/startstop/Main.java b/main/src/main/java/org/onap/policy/pdpx/main/startstop/Main.java index 2e3c4461..91b38f9b 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/startstop/Main.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/startstop/Main.java @@ -41,6 +41,9 @@ public class Main { // The parameters read in from JSON private XacmlPdpParameterGroup parameterGroup; + // The argument message for some args that return a message + private String argumentMessage = null; + /** * Instantiates the policy xacml pdp service. * @@ -54,7 +57,7 @@ public class Main { final XacmlPdpCommandLineArguments arguments = new XacmlPdpCommandLineArguments(); try { // The arguments return a string if there is a message to print and we should exit - final String argumentMessage = arguments.parse(args); + argumentMessage = arguments.parse(args); if (argumentMessage != null) { LOGGER.info(argumentMessage); return; @@ -100,6 +103,15 @@ public class Main { return parameterGroup; } + /** + * Get the argumentMessage string. + * + * @return the argumentMessage + */ + public String getArgumentMessage() { + return argumentMessage; + } + /** * Shut down Execution. * diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java index ce0671a6..d9a0e9b0 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java @@ -23,7 +23,9 @@ package org.onap.policy.pdpx.main.rest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import java.io.IOException; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Invocation; @@ -33,6 +35,7 @@ import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; import org.junit.Test; import org.onap.policy.common.endpoints.report.HealthCheckReport; +import org.onap.policy.common.utils.network.NetworkUtil; import org.onap.policy.pdpx.main.PolicyXacmlPdpException; import org.onap.policy.pdpx.main.parameters.CommonTestData; import org.onap.policy.pdpx.main.parameters.RestServerParameters; @@ -56,10 +59,16 @@ public class TestXacmlPdpRestServer { @Test public void testHealthCheckSuccess() throws PolicyXacmlPdpException, InterruptedException { final String reportString = "Report [name=Policy Xacml PDP, url=self, healthy=true, code=200, message=alive]"; - final Main main = startXacmlPdpService(); - final HealthCheckReport report = performHealthCheck(); - validateReport(NAME, SELF, true, 200, ALIVE, reportString, report); - stopXacmlPdpService(main); + try { + final Main main = startXacmlPdpService(); + final HealthCheckReport report = performHealthCheck(); + validateReport(NAME, SELF, true, 200, ALIVE, reportString, report); + stopXacmlPdpService(main); + } catch (final Exception e) { + LOGGER.error("testHealthCheckSuccess failed", e); + fail("Test should not throw an exception"); + } + } @Test @@ -69,12 +78,18 @@ public class TestXacmlPdpRestServer { final RestServerParameters restServerParams = new CommonTestData().getRestServerParameters(false); restServerParams.setName(CommonTestData.PDPX_GROUP_NAME); final XacmlPdpRestServer restServer = new XacmlPdpRestServer(restServerParams); - restServer.start(); - final HealthCheckReport report = performHealthCheck(); - validateReport(NAME, SELF, false, 500, NOT_ALIVE, reportString, report); - assertTrue(restServer.isAlive()); - assertTrue(restServer.toString().startsWith("XacmlPdpRestServer [servers=")); - restServer.shutdown(); + + try { + restServer.start(); + final HealthCheckReport report = performHealthCheck(); + validateReport(NAME, SELF, false, 500, NOT_ALIVE, reportString, report); + assertTrue(restServer.isAlive()); + assertTrue(restServer.toString().startsWith("XacmlPdpRestServer [servers=")); + restServer.shutdown(); + } catch (final Exception e) { + LOGGER.error("testHealthCheckSuccess failed", e); + fail("Test should not throw an exception"); + } } private Main startXacmlPdpService() { @@ -86,8 +101,8 @@ public class TestXacmlPdpRestServer { main.shutdown(); } - private HealthCheckReport performHealthCheck() throws InterruptedException { - HealthCheckReport response = null; + private HealthCheckReport performHealthCheck() throws InterruptedException, IOException { + final ClientConfig clientConfig = new ClientConfig(); final HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic("healthcheck", "zb!XztG34"); @@ -98,15 +113,11 @@ public class TestXacmlPdpRestServer { final Invocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON); - final long startTime = System.currentTimeMillis(); - while (response == null && (System.currentTimeMillis() - startTime) < 120000) { - try { - response = invocationBuilder.get(HealthCheckReport.class); - } catch (final Exception exp) { - LOGGER.info("the server is not started yet. We will retry again"); - } + if (!NetworkUtil.isTcpPortOpen("localhost", 6969, 6, 10000L)) { + throw new IllegalStateException("Cannot connect to port 6969"); } - return response; + + return invocationBuilder.get(HealthCheckReport.class); } private void validateReport(final String name, final String url, final boolean healthy, final int code, diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpStatistics.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpStatistics.java index 303a3cfe..b38e92d2 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpStatistics.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpStatistics.java @@ -22,17 +22,18 @@ package org.onap.policy.pdpx.main.rest; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; +import java.io.IOException; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Invocation; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.MediaType; - import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; import org.junit.Test; - +import org.onap.policy.common.utils.network.NetworkUtil; import org.onap.policy.pdpx.main.PolicyXacmlPdpException; import org.onap.policy.pdpx.main.parameters.CommonTestData; import org.onap.policy.pdpx.main.parameters.RestServerParameters; @@ -49,38 +50,44 @@ public class TestXacmlPdpStatistics { private static final Logger LOGGER = LoggerFactory.getLogger(TestXacmlPdpStatistics.class); - @Test public void testXacmlPdpStatistics_200() throws PolicyXacmlPdpException, InterruptedException { - final Main main = startXacmlPdpService(); - StatisticsReport report = getXacmlPdpStatistics(); - - validateReport(report, 0, 200); - updateXacmlPdpStatistics(); - report = getXacmlPdpStatistics(); - validateReport(report, 1, 200); - stopXacmlPdpService(main); - XacmlPdpStatisticsManager.resetAllStatistics(); + try { + final Main main = startXacmlPdpService(); + StatisticsReport report = getXacmlPdpStatistics(); + validateReport(report, 0, 200); + updateXacmlPdpStatistics(); + report = getXacmlPdpStatistics(); + validateReport(report, 1, 200); + stopXacmlPdpService(main); + XacmlPdpStatisticsManager.resetAllStatistics(); + } catch (final Exception e) { + LOGGER.error("testApiStatistics_200 failed", e); + fail("Test should not throw an exception"); + } } @Test public void testXacmlPdpStatistics_500() throws InterruptedException { final RestServerParameters restServerParams = new CommonTestData().getRestServerParameters(false); restServerParams.setName(CommonTestData.PDPX_GROUP_NAME); - final XacmlPdpRestServer restServer = new XacmlPdpRestServer(restServerParams); - restServer.start(); - final StatisticsReport report = getXacmlPdpStatistics(); - validateReport(report, 0, 500); - restServer.shutdown(); - XacmlPdpStatisticsManager.resetAllStatistics(); + try { + restServer.start(); + final StatisticsReport report = getXacmlPdpStatistics(); + validateReport(report, 0, 500); + restServer.shutdown(); + XacmlPdpStatisticsManager.resetAllStatistics(); + } catch (final Exception e) { + LOGGER.error("testApiStatistics_500 failed", e); + fail("Test should not throw an exception"); + } } private Main startXacmlPdpService() { - final String[] XacmlPdpConfigParameters = - { "-c", "parameters/XacmlPdpConfigParameters.json" }; + final String[] XacmlPdpConfigParameters = {"-c", "parameters/XacmlPdpConfigParameters.json"}; return new Main(XacmlPdpConfigParameters); } @@ -88,8 +95,8 @@ public class TestXacmlPdpStatistics { main.shutdown(); } - private StatisticsReport getXacmlPdpStatistics() throws InterruptedException { - StatisticsReport response = null; + private StatisticsReport getXacmlPdpStatistics() throws InterruptedException, IOException { + final ClientConfig clientConfig = new ClientConfig(); final HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic("healthcheck", "zb!XztG34"); @@ -99,15 +106,12 @@ public class TestXacmlPdpStatistics { final WebTarget webTarget = client.target("http://localhost:6969/statistics"); final Invocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON); - final long startTime = System.currentTimeMillis(); - while (response == null && (System.currentTimeMillis() - startTime) < 120000) { - try { - response = invocationBuilder.get(StatisticsReport.class); - } catch (final Exception exp) { - LOGGER.info("the server is not started yet. We will retry again"); - } + + if (!NetworkUtil.isTcpPortOpen("localhost", 6969, 6, 10000L)) { + throw new IllegalStateException("Cannot connect to port 6969"); } - return response; + + return invocationBuilder.get(StatisticsReport.class); } private void updateXacmlPdpStatistics() { diff --git a/main/src/test/java/org/onap/policy/pdpx/main/startstop/TestMain.java b/main/src/test/java/org/onap/policy/pdpx/main/startstop/TestMain.java index 8178343c..bfc8a2a4 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/startstop/TestMain.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/startstop/TestMain.java @@ -24,6 +24,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import org.junit.Assert; import org.junit.Test; import org.onap.policy.pdpx.main.PolicyXacmlPdpException; import org.onap.policy.pdpx.main.parameters.CommonTestData; @@ -44,10 +45,11 @@ public class TestMain { } @Test - public void testMain_NoArguments() { + public void testMain_NoArguments() throws PolicyXacmlPdpException { final String[] xacmlPdpConfigParameters = {}; final Main main = new Main(xacmlPdpConfigParameters); assertNull(main.getParameters()); + main.shutdown(); } @Test @@ -60,7 +62,10 @@ public class TestMain { @Test public void testMain_Help() { final String[] xacmlPdpConfigParameters = {"-h"}; - Main.main(xacmlPdpConfigParameters); + final Main main = new Main(xacmlPdpConfigParameters); + final String message = "-h,--help outputs the usage of this command"; + Assert.assertTrue(main.getArgumentMessage().contains(message)); + } @Test diff --git a/packages/policy-xacmlpdp-docker/pom.xml b/packages/policy-xacmlpdp-docker/pom.xml new file mode 100644 index 00000000..bc45b3fb --- /dev/null +++ b/packages/policy-xacmlpdp-docker/pom.xml @@ -0,0 +1,176 @@ + + + + + 4.0.0 + + org.onap.policy.xacml-pdp + packages + 2.0.0-SNAPSHOT + + + pom + policy-xacmlpdp-docker + + ${project.artifactId} + Creates Policy Xacml PDP docker images + + + UTF-8 + UTF-8 + ${project.version} + false + false + false + nexus3.onap.org:10001 + nexus3.onap.org:10003 + yyyyMMdd'T'HHmm + + + + ${project.artifactId}-${project.version} + + + org.codehaus.groovy.maven + gmaven-plugin + 1.0 + + + validate + + execute + + + + println 'Project version: ' + project.properties['pdpx.project.version']; + def versionArray; + if ( project.properties['pdpx.project.version'] != null ) { + versionArray = project.properties['pdpx.project.version'].split('-'); + } + + if ( project.properties['pdpx.project.version'].endsWith("-SNAPSHOT") ) { + project.properties['project.docker.latesttag.version']=versionArray[0] + "-SNAPSHOT-latest"; + } else { + project.properties['project.docker.latesttag.version']=versionArray[0] + "-STAGING-latest"; + } + + println 'New tag for docker: ' + project.properties['project.docker.latesttag.version']; + + + + + + + + io.fabric8 + docker-maven-plugin + 0.19.1 + + + true + 1.23 + ${docker.pull.registry} + ${docker.push.registry} + + + + onap/policy-xacml-pdp + + try + Dockerfile + + ${project.version} + ${project.version}-${maven.build.timestamp} + ${project.docker.latesttag.version} + + + + + + + org.onap.policy.xacmlpdp:policy-xacmlpdp-tarball + + /lib + policy-xacmlpdp.tar.gz + + + + + + + + + + + + clean-images + pre-clean + + remove + + + true + + + + + generate-images + generate-sources + + build + + + + + push-images + deploy + + build + push + + + onap/policy-xacmp-pdp + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + + + org.onap.policy.xacml-pdp + policy-xacmlpdp-tarball + ${project.version} + tarball + tar.gz + + + diff --git a/packages/policy-xacmlpdp-docker/src/main/docker/Dockerfile b/packages/policy-xacmlpdp-docker/src/main/docker/Dockerfile new file mode 100644 index 00000000..b5f8af30 --- /dev/null +++ b/packages/policy-xacmlpdp-docker/src/main/docker/Dockerfile @@ -0,0 +1,46 @@ +FROM ubuntu:16.04 + +ARG HTTP_PROXY=${HTTP_PROXY} +ARG HTTPS_PROXY=${HTTPS_PROXY} +ARG BUILD_VERSION=${BUILD_VERSION} +ARG POLICY_LOGS=/var/log/onap/policy/pdpx + +ENV http_proxy $HTTP_PROXY +ENV https_proxy $HTTPS_PROXY +ENV BUILD_VERSION ${BUILD_VERSION} +ENV POLICY_LOGS ${POLICY_LOGS} + +ENV POLICY_HOME=/opt/app/policy +ENV POLICY_PDPX_HOME=${POLICY_HOME}/pdpx + +RUN \ + apt-get clean && \ + apt-get update && \ + apt-get install -y zip unzip curl wget ssh telnet maven && \ + apt-get install -y software-properties-common && \ + apt-get install -y jq httpie && \ + apt-get install -y python-pip && \ + add-apt-repository ppa:openjdk-r/ppa && \ + apt-get clean && \ + apt-get update && \ + apt-get install -y openjdk-8-jdk + +RUN groupadd policy +RUN useradd --create-home --shell /bin/bash -g policy policy + +RUN mkdir -p ${POLICY_PDPX_HOME} ${POLICY_LOGS} ${POLICY_HOME}/etc/ssl ${POLICY_PDPX_HOME}/bin && \ + chown -R policy:policy ${POLICY_HOME} ${POLICY_PDPX_HOME} ${POLICY_LOGS} + +RUN mkdir /packages +COPY /maven/* /packages +RUN tar xvfz /packages/policy-xacml-pdp.tar.gz --directory ${POLICY_PDPX_HOME} +RUN rm /packages/policy-xacml-pdp.tar.gz + +WORKDIR ${POLICY_PDPX_HOME} +COPY policy-pdpx.sh bin/. +RUN chown -R policy:policy * && chmod +x bin/*.sh +RUN cp ${POLICY_PDPX_HOME}/etc/ssl/* ${POLICY_HOME}/etc/ssl && chown policy:policy ${POLICY_HOME}/etc/ssl/* + +USER policy +WORKDIR ${POLICY_PDPX_HOME}/bin +ENTRYPOINT [ "bash", "./policy-pdpx.sh" ] diff --git a/packages/policy-xacmlpdp-docker/src/main/docker/policy-pdpx.sh b/packages/policy-xacmlpdp-docker/src/main/docker/policy-pdpx.sh new file mode 100644 index 00000000..aff8d8e0 --- /dev/null +++ b/packages/policy-xacmlpdp-docker/src/main/docker/policy-pdpx.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +# + +JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/ +POLICY_PDPX_HOME=/opt/app/policy/pdpx +KEYSTORE="${POLICY_HOME}/etc/ssl/policy-keystore" +KEYSTORE_PASSWD="Pol1cy_0nap" +TRUSTSTORE="${POLICY_HOME}/etc/ssl/policy-truststore" +TRUSTSTORE_PASSWD="Pol1cy_0nap" + + +if [ "$#" -eq 1 ]; then + CONFIG_FILE=$1 +else + CONFIG_FILE=${CONFIG_FILE} +fi + +if [ -z "$CONFIG_FILE" ] + then + CONFIG_FILE="$POLICY_PDPX_HOME/etc/defaultConfig.json" +fi + +echo "Policy Xacml PDP config file: $CONFIG_FILE" + +$JAVA_HOME/bin/java -cp "$POLICY_PDPX_HOME/etc:$POLICY_PDPX_HOME/lib/*" -Djavax.net.ssl.keyStore="$KEYSTORE" -Djavax.net.ssl.keyStorePassword="$KEYSTORE_PASSWD" -Djavax.net.ssl.trustStore="$TRUSTSTORE" -Djavax.net.ssl.trustStorePassword="$TRUSTSTORE_PASSWD" org.onap.policy.xacmlpdp.main.startstop.Main -c $CONFIG_FILE diff --git a/packages/policy-xacmlpdp-tarball/pom.xml b/packages/policy-xacmlpdp-tarball/pom.xml new file mode 100644 index 00000000..2605d942 --- /dev/null +++ b/packages/policy-xacmlpdp-tarball/pom.xml @@ -0,0 +1,65 @@ + + + + 4.0.0 + + org.onap.policy.xacml-pdp + packages + 2.0.0-SNAPSHOT + + + policy-xacmlpdp-tarball + ${project.artifactId} + Creates the zip pacakge of entire Xacml PDP component + + + + org.onap.policy.xacml-pdp + main + ${project.version} + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + generate-complete-tar + package + + single + + + + src/main/package/tarball/assembly.xml + + ${project.artifactId}-${project.version} + + + + + + + diff --git a/packages/policy-xacmlpdp-tarball/src/main/package/tarball/assembly.xml b/packages/policy-xacmlpdp-tarball/src/main/package/tarball/assembly.xml new file mode 100644 index 00000000..4c76c5a9 --- /dev/null +++ b/packages/policy-xacmlpdp-tarball/src/main/package/tarball/assembly.xml @@ -0,0 +1,70 @@ + + + + tarball + + tar.gz + + false + + + true + /lib + false + runtime + + *:jar + + + + + + ${project.basedir}/src/main/resources + + policyLogger.properties + + /bin/config + unix + + + ${project.basedir}/src/main/resources/etc + + + *.json + *.xml + + /etc + unix + + *.formatted + + + + ${project.basedir}/src/main/resources/etc/ssl + + + policy* + + /etc/ssl + keep + + + diff --git a/packages/policy-xacmlpdp-tarball/src/main/resources/etc/defaultConfig.json b/packages/policy-xacmlpdp-tarball/src/main/resources/etc/defaultConfig.json new file mode 100644 index 00000000..561574a2 --- /dev/null +++ b/packages/policy-xacmlpdp-tarball/src/main/resources/etc/defaultConfig.json @@ -0,0 +1,11 @@ +{ + "name": "XacmlPdpGroup", + "restServerParameters": { + "host": "0.0.0.0", + "port": 6969, + "userName": "healthcheck", + "password": "zb!XztG34", + "https": true, + "aaf": false + } +} diff --git a/packages/policy-xacmlpdp-tarball/src/main/resources/etc/logback.xml b/packages/policy-xacmlpdp-tarball/src/main/resources/etc/logback.xml new file mode 100644 index 00000000..6f825611 --- /dev/null +++ b/packages/policy-xacmlpdp-tarball/src/main/resources/etc/logback.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + ${logDir}/${errorLog}.log + + ${logDir}/${errorLog}.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + WARN + + + ${errorPattern} + + + + + + + + + ${logDir}/${debuLog}.log + + ${logDir}/${debugLog}.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 30 + 10GB + + + DEBUG + + + ${debugPattern} + + + + + + + + + ${logDir}/${metricsLog}.log + + ${logDir}/${metricsLog}.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 30 + 10GB + + + ${metricPattern} + + + + + + + + + ${logDir}/${networkLog}.log + + ${logDir}/${networkLog}.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + ${networkPattern} + + + + + + + + + ${logDir}/${transactionLog}.log + + ${logDir}/${transactionLog}.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + ${transactionPattern} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/policy-xacmlpdp-tarball/src/main/resources/etc/s3pConfig.json b/packages/policy-xacmlpdp-tarball/src/main/resources/etc/s3pConfig.json new file mode 100644 index 00000000..54be41a7 --- /dev/null +++ b/packages/policy-xacmlpdp-tarball/src/main/resources/etc/s3pConfig.json @@ -0,0 +1,11 @@ +{ + "name":"XacmlPdpGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34", + "https": true, + "aaf": false + } +} diff --git a/packages/policy-xacmlpdp-tarball/src/main/resources/etc/ssl/policy-keystore b/packages/policy-xacmlpdp-tarball/src/main/resources/etc/ssl/policy-keystore new file mode 100644 index 00000000..7d2b1ecc Binary files /dev/null and b/packages/policy-xacmlpdp-tarball/src/main/resources/etc/ssl/policy-keystore differ diff --git a/packages/policy-xacmlpdp-tarball/src/main/resources/etc/ssl/policy-truststore b/packages/policy-xacmlpdp-tarball/src/main/resources/etc/ssl/policy-truststore new file mode 100644 index 00000000..8834ac25 Binary files /dev/null and b/packages/policy-xacmlpdp-tarball/src/main/resources/etc/ssl/policy-truststore differ diff --git a/packages/pom.xml b/packages/pom.xml new file mode 100644 index 00000000..34bdbe85 --- /dev/null +++ b/packages/pom.xml @@ -0,0 +1,54 @@ + + + + 4.0.0 + + org.onap.policy.xacml-pdp + policy-xacml-pdp + 2.0.0-SNAPSHOT + + + packages + pom + + ${project.artifactId} + The module for packaging the Xacml PDP component + + + + default + + true + + + + docker + + policy-xacmlpdp-tarball + policy-xacmlpdp-docker + + + false + + + + diff --git a/pom.xml b/pom.xml index 8c4c6a51..03d633f3 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ org.onap.policy.parent integration - 2.0.0 + 2.1.0-SNAPSHOT @@ -50,6 +50,7 @@ main + packages @@ -61,7 +62,6 @@ org.assertj assertj-core - 3.11.1 test -- cgit 1.2.3-korg