diff options
Diffstat (limited to 'controlloop/packages/docker-controlloop')
3 files changed, 42 insertions, 11 deletions
diff --git a/controlloop/packages/docker-controlloop/pom.xml b/controlloop/packages/docker-controlloop/pom.xml index f709585ee..a4c893a19 100644 --- a/controlloop/packages/docker-controlloop/pom.xml +++ b/controlloop/packages/docker-controlloop/pom.xml @@ -3,7 +3,7 @@ ONAP ================================================================================ Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2019 Bell Canada. + Modifications Copyright (C) 2019-2020 Bell Canada. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -80,6 +80,32 @@ </execution> </executions> </plugin> + <!--fabric8.io docker-maven-plugin does not support ARG usage in the FROM statement of Dockerfile + even though docker supports it: https://github.com/fabric8io/docker-maven-plugin/issues/859. + As a workaround we shall use maven-antrun-plugin to copy the Dockerfile and apply filters to + replace the parameterized base-image version. The fabric8.io docker-maven-plugin shall use this filtered file + to build the image. After the image is built we perform a cleanup to remove the filtered file.--> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>update-parameterized-dockerfile</id> + <phase>initialize</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks> + <copy file="src/main/docker/Dockerfile" toFile="${project.build.directory}/docker-tmp/Dockerfile"> + <filterset> + <filter token="version.policy.drools-pdp" value="${version.policy.drools-pdp}"/> + </filterset> + </copy> + </tasks> + </configuration> + </execution> + </executions> + </plugin> <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> @@ -93,6 +119,7 @@ <name>onap/policy-pdpd-cl</name> <build> <cleanup>try</cleanup> + <contextDir>${project.build.directory}/docker-tmp</contextDir> <dockerFile>Dockerfile</dockerFile> <tags> <tag>${project.version}</tag> diff --git a/controlloop/packages/docker-controlloop/src/main/docker/Dockerfile b/controlloop/packages/docker-controlloop/src/main/docker/Dockerfile index 14e8c7400..98bf35a8e 100644 --- a/controlloop/packages/docker-controlloop/src/main/docker/Dockerfile +++ b/controlloop/packages/docker-controlloop/src/main/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM onap/policy-drools:1.6-SNAPSHOT-latest +FROM onap/policy-drools:@version.policy.drools-pdp@ ARG BUILD_VERSION_APP_CL=${BUILD_VERSION_APP_CL} ENV BUILD_VERSION_APP_CL=${BUILD_VERSION_APP_CL} diff --git a/controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh b/controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh index c48cf6422..a1d689a07 100644 --- a/controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh +++ b/controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/bash # ######################################################################## -# Copyright 2019 AT&T Intellectual Property. All rights reserved +# Copyright 2019-2020 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. @@ -38,7 +38,7 @@ function maven { fi } -function configurations { +function systemConfs { if [[ ${DEBUG} == y ]]; then echo "-- ${FUNCNAME[0]} --" set -x @@ -51,7 +51,7 @@ function configurations { fi for c in $(ls "${POLICY_INSTALL_INIT}"/*.conf 2> /dev/null); do - echo "adding configuration file: ${c}" + echo "adding system conf file: ${c}" cp -f "${c}" "${POLICY_HOME}"/etc/profile.d/ confName="$(basename "${c}")" sed -i -e "s/ *= */=/" -e "s/=\([^\"\']*$\)/='\1'/" "${POLICY_HOME}/etc/profile.d/${confName}" @@ -126,18 +126,20 @@ function security { fi } -function properties { +function serverConfig { if [[ ${DEBUG} == y ]]; then echo "-- ${FUNCNAME[0]} --" set -x fi - if ! ls "${POLICY_INSTALL_INIT}"/*.properties > /dev/null 2>&1; then + local configExtSuffix=${1:-"properties"} + + if ! ls "${POLICY_INSTALL_INIT}"/*."${configExtSuffix}" > /dev/null 2>&1; then return 0 fi - for p in $(ls "${POLICY_INSTALL_INIT}"/*.properties 2> /dev/null); do - echo "configuration properties: ${p}" + for p in $(ls "${POLICY_INSTALL_INIT}"/*."${configExtSuffix}" 2> /dev/null); do + echo "configuration ${configExtSuffix}: ${p}" cp -f "${p}" "${POLICY_HOME}"/config done } @@ -225,11 +227,13 @@ function reload { set -x fi - configurations + systemConfs maven features security - properties + serverConfig "properties" + serverConfig "xml" + serverConfig "json" scripts "pre.sh" } |