diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2021-07-23 15:53:46 +0100 |
---|---|---|
committer | FrancescoFioraEst <francesco.fiora@est.tech> | 2021-07-27 16:05:33 +0100 |
commit | 252a4bba14ebfa2bc58261a87d7c593414a5f944 (patch) | |
tree | 0b4a5ef00405c06cb527d351e820af01f9434f86 /packages/policy-clamp-docker/src/main/docker | |
parent | 395f61064ab29a9506a18bae505ebf1da3315e94 (diff) |
Replace JSON properties files to Yaml from docker images
POLICY-3469: Replace JSON properties files to Yaml from docker images
Change-Id: I23fbd9d84640286725440453d464c397e3144662
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'packages/policy-clamp-docker/src/main/docker')
8 files changed, 46 insertions, 25 deletions
diff --git a/packages/policy-clamp-docker/src/main/docker/ClRuntimeDockerfile b/packages/policy-clamp-docker/src/main/docker/ClRuntimeDockerfile index bd5000686..3d57418e5 100644 --- a/packages/policy-clamp-docker/src/main/docker/ClRuntimeDockerfile +++ b/packages/policy-clamp-docker/src/main/docker/ClRuntimeDockerfile @@ -33,14 +33,18 @@ ENV POLICY_HOME=$POLICY_HOME/clamp RUN mkdir -p $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \ chown -R policy:policy $POLICY_HOME $POLICY_LOGS && \ mkdir /packages -COPY /maven/* /packages +COPY /maven/lib/policy-controlloop-runtime.tar.gz /packages + RUN tar xvfz /packages/policy-controlloop-runtime.tar.gz --directory $POLICY_HOME && \ rm /packages/policy-controlloop-runtime.tar.gz WORKDIR $POLICY_HOME COPY controlloop-runtime.sh bin/. +COPY /maven/app.jar /app -RUN chown -R policy:policy * && chmod 755 bin/*.sh +RUN chown -R policy:policy * && \ + chmod 755 bin/*.sh && \ + chown -R policy:policy /app USER policy WORKDIR $POLICY_HOME/bin diff --git a/packages/policy-clamp-docker/src/main/docker/DcaeParticipantDockerfile b/packages/policy-clamp-docker/src/main/docker/DcaeParticipantDockerfile index 368b9348a..ed09c50d3 100644 --- a/packages/policy-clamp-docker/src/main/docker/DcaeParticipantDockerfile +++ b/packages/policy-clamp-docker/src/main/docker/DcaeParticipantDockerfile @@ -34,15 +34,16 @@ RUN mkdir -p $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \ chown -R policy:policy $POLICY_HOME $POLICY_LOGS && \ mkdir /packages COPY /maven/lib/dcae-participant.tar.gz /packages + RUN tar xvfz /packages/dcae-participant.tar.gz --directory $POLICY_HOME && \ - rm /packages/dcae-participant.tar.gz && \ - rm -rf $POLICY_HOME/lib + rm /packages/dcae-participant.tar.gz WORKDIR $POLICY_HOME COPY dcae-participant.sh bin/. COPY /maven/app.jar /app -RUN chown -R policy:policy * && chmod 755 bin/*.sh && \ +RUN chown -R policy:policy * && \ + chmod 755 bin/*.sh && \ chown -R policy:policy /app USER policy diff --git a/packages/policy-clamp-docker/src/main/docker/KubernetesParticipantDockerfile b/packages/policy-clamp-docker/src/main/docker/KubernetesParticipantDockerfile index 63209d75f..d08e14fff 100644 --- a/packages/policy-clamp-docker/src/main/docker/KubernetesParticipantDockerfile +++ b/packages/policy-clamp-docker/src/main/docker/KubernetesParticipantDockerfile @@ -36,8 +36,7 @@ RUN mkdir -p $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \ COPY /maven/lib/kubernetes-participant.tar.gz /packages RUN tar xvfz /packages/kubernetes-participant.tar.gz --directory $POLICY_HOME && \ - rm /packages/kubernetes-participant.tar.gz && \ - rm -rf $POLICY_HOME/lib + rm /packages/kubernetes-participant.tar.gz WORKDIR $POLICY_HOME COPY kubernetes-participant.sh bin/. diff --git a/packages/policy-clamp-docker/src/main/docker/PolicyParticipantDockerfile b/packages/policy-clamp-docker/src/main/docker/PolicyParticipantDockerfile index 3c2082202..8eca34d42 100644 --- a/packages/policy-clamp-docker/src/main/docker/PolicyParticipantDockerfile +++ b/packages/policy-clamp-docker/src/main/docker/PolicyParticipantDockerfile @@ -34,15 +34,16 @@ RUN mkdir -p $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \ chown -R policy:policy $POLICY_HOME $POLICY_LOGS && \ mkdir /packages COPY /maven/lib/policy-participant.tar.gz /packages + RUN tar xvfz /packages/policy-participant.tar.gz --directory $POLICY_HOME && \ - rm /packages/policy-participant.tar.gz && \ - rm -rf $POLICY_HOME/lib + rm /packages/policy-participant.tar.gz WORKDIR $POLICY_HOME COPY policy-participant.sh bin/. COPY /maven/app.jar /app -RUN chown -R policy:policy * && chmod 755 bin/*.sh && \ +RUN chown -R policy:policy * && \ + chmod 755 bin/*.sh && \ chown -R policy:policy /app USER policy diff --git a/packages/policy-clamp-docker/src/main/docker/controlloop-runtime.sh b/packages/policy-clamp-docker/src/main/docker/controlloop-runtime.sh index 8d64fa5a4..6d12e590a 100644 --- a/packages/policy-clamp-docker/src/main/docker/controlloop-runtime.sh +++ b/packages/policy-clamp-docker/src/main/docker/controlloop-runtime.sh @@ -32,7 +32,7 @@ else fi if [ -z "$CONFIG_FILE" ]; then - CONFIG_FILE="${POLICY_HOME}/etc/ClRuntimeParameters.json" + CONFIG_FILE="${POLICY_HOME}/etc/ClRuntimeParameters.yaml" fi echo "Policy clamp config file: $CONFIG_FILE" @@ -48,15 +48,17 @@ if [ -f "${POLICY_HOME}/etc/mounted/policy-keystore" ]; then fi if [ -f "${POLICY_HOME}/etc/mounted/logback.xml" ]; then - echo "overriding logback.xml" - cp -f "${POLICY_HOME}"/etc/mounted/logback.xml "${POLICY_HOME}"/etc/ + echo "overriding logback xml files" + cp -f "${POLICY_HOME}"/etc/mounted/logback*.xml "${POLICY_HOME}"/etc/ fi -$JAVA_HOME/bin/java -cp "${POLICY_HOME}/etc:${POLICY_HOME}/lib/*" \ - -Dlogback.configurationFile="${POLICY_HOME}/etc/logback.xml" \ - -Djavax.net.ssl.keyStore="${KEYSTORE}" \ +touch /app/app.jar +mkdir -p "${POLICY_HOME}"/config/ +cp -f "${CONFIG_FILE}" "${POLICY_HOME}"/config/ClRuntimeParameters.yaml + +$JAVA_HOME/bin/java -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.clamp.controlloop.runtime.main.startstop.Main \ - -c "${CONFIG_FILE}" + -jar /app/app.jar \ + --spring.config.location="${POLICY_HOME}/config/ClRuntimeParameters.yaml" diff --git a/packages/policy-clamp-docker/src/main/docker/dcae-participant.sh b/packages/policy-clamp-docker/src/main/docker/dcae-participant.sh index 4acb17b39..620fa42cd 100644 --- a/packages/policy-clamp-docker/src/main/docker/dcae-participant.sh +++ b/packages/policy-clamp-docker/src/main/docker/dcae-participant.sh @@ -32,7 +32,7 @@ else fi if [ -z "$CONFIG_FILE" ]; then - CONFIG_FILE="${POLICY_HOME}/etc/DcaeParticipantParameters.json" + CONFIG_FILE="${POLICY_HOME}/etc/DcaeParticipantParameters.yaml" fi echo "Policy clamp config file: $CONFIG_FILE" @@ -54,11 +54,11 @@ fi touch /app/app.jar mkdir -p "${POLICY_HOME}"/config/ -cp -f "${CONFIG_FILE}" "${POLICY_HOME}"/config/ +cp -f "${CONFIG_FILE}" "${POLICY_HOME}"/config/DcaeParticipantParameters.yaml $JAVA_HOME/bin/java -Djavax.net.ssl.keyStore="${KEYSTORE}" \ -Djavax.net.ssl.keyStorePassword="${KEYSTORE_PASSWD}" \ -Djavax.net.ssl.trustStore="${TRUSTSTORE}" \ -Djavax.net.ssl.trustStorePassword="${TRUSTSTORE_PASSWD}" \ -jar /app/app.jar \ - --participant.file="${POLICY_HOME}/config/DcaeParticipantParameters.json" + --spring.config.location="${POLICY_HOME}/config/DcaeParticipantParameters.yaml" diff --git a/packages/policy-clamp-docker/src/main/docker/kubernetes-participant.sh b/packages/policy-clamp-docker/src/main/docker/kubernetes-participant.sh index 50995de3b..cb5ae9251 100644 --- a/packages/policy-clamp-docker/src/main/docker/kubernetes-participant.sh +++ b/packages/policy-clamp-docker/src/main/docker/kubernetes-participant.sh @@ -25,7 +25,17 @@ TRUSTSTORE="${TRUSTSTORE:-$POLICY_HOME/etc/ssl/policy-truststore}" KEYSTORE_PASSWD="${KEYSTORE_PASSWD:-Pol1cy_0nap}" TRUSTSTORE_PASSWD="${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_HOME}/etc/KubernetesParticipantParameters.yaml" +fi +echo "Policy clamp config file: $CONFIG_FILE" if [ -f "${POLICY_HOME}/etc/mounted/policy-truststore" ]; then echo "overriding policy-truststore" @@ -42,8 +52,12 @@ if [ -f "${POLICY_HOME}/etc/mounted/logback.xml" ]; then cp -f "${POLICY_HOME}"/etc/mounted/logback*.xml "${POLICY_HOME}"/etc/ fi +mkdir -p "${POLICY_HOME}"/config/ +cp -f "${CONFIG_FILE}" "${POLICY_HOME}"/config/KubernetesParticipantParameters.yaml + $JAVA_HOME/bin/java -Dserver.ssl.keyStore="${KEYSTORE}" \ -Dserver.ssl.keyStorePassword="${KEYSTORE_PASSWD}" \ -Dserver.ssl.trustStore="${TRUSTSTORE}" \ -Dserver.ssl.trustStorePassword="${TRUSTSTORE_PASSWD}" \ - -jar /app/app.jar + -jar /app/app.jar \ + --spring.config.location="${POLICY_HOME}/config/KubernetesParticipantParameters.yaml" diff --git a/packages/policy-clamp-docker/src/main/docker/policy-participant.sh b/packages/policy-clamp-docker/src/main/docker/policy-participant.sh index 2e7a7d54b..7949fab72 100644 --- a/packages/policy-clamp-docker/src/main/docker/policy-participant.sh +++ b/packages/policy-clamp-docker/src/main/docker/policy-participant.sh @@ -32,7 +32,7 @@ else fi if [ -z "$CONFIG_FILE" ]; then - CONFIG_FILE="${POLICY_HOME}/etc/PolicyParticipantParameters.json" + CONFIG_FILE="${POLICY_HOME}/etc/PolicyParticipantParameters.yaml" fi echo "Policy clamp config file: $CONFIG_FILE" @@ -54,11 +54,11 @@ fi touch /app/app.jar mkdir -p "${POLICY_HOME}"/config/ -cp -f "${CONFIG_FILE}" "${POLICY_HOME}"/config/ +cp -f "${CONFIG_FILE}" "${POLICY_HOME}"/config/PolicyParticipantParameters.yaml $JAVA_HOME/bin/java -Djavax.net.ssl.keyStore="${KEYSTORE}" \ -Djavax.net.ssl.keyStorePassword="${KEYSTORE_PASSWD}" \ -Djavax.net.ssl.trustStore="${TRUSTSTORE}" \ -Djavax.net.ssl.trustStorePassword="${TRUSTSTORE_PASSWD}" \ -jar /app/app.jar \ - --participant.file="${POLICY_HOME}/config/PolicyParticipantParameters.json" + --spring.config.location="${POLICY_HOME}/config/PolicyParticipantParameters.yaml" |