diff options
Diffstat (limited to 'packages')
3 files changed, 24 insertions, 26 deletions
diff --git a/packages/policy-distribution-docker/pom.xml b/packages/policy-distribution-docker/pom.xml index 1e6a606c..02d9658e 100644 --- a/packages/policy-distribution-docker/pom.xml +++ b/packages/policy-distribution-docker/pom.xml @@ -61,19 +61,19 @@ </goals> <configuration> <source> - println 'Project version: ' + project.properties['dist.project.version']; - def versionArray; - if ( project.properties['dist.project.version'] != null ) { - versionArray = project.properties['dist.project.version'].split('-'); + println 'Project version: ' + project.properties['dist.project.version'] + if (project.properties['dist.project.version'] != null) { + def versionArray = project.properties['dist.project.version'].split('-') + def minMaxVersionArray = versionArray[0].tokenize('.') + if (project.properties['dist.project.version'].endsWith("-SNAPSHOT")) { + project.properties['project.docker.latest.minmax.tag.version'] = + minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-SNAPSHOT-latest" + } else { + project.properties['project.docker.latest.minmax.tag.version'] = + minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-STAGING-latest" + } + println 'New tag for docker: ' + project.properties['project.docker.latest.minmax.tag.version'] } - - if ( project.properties['dist.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']; </source> </configuration> </execution> @@ -100,7 +100,7 @@ <tags> <tag>${project.version}</tag> <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> + <tag>${project.docker.latest.minmax.tag.version}</tag> </tags> <assembly> <inline> diff --git a/packages/policy-distribution-docker/src/main/docker/Dockerfile b/packages/policy-distribution-docker/src/main/docker/Dockerfile index db26c161..54d268ce 100644 --- a/packages/policy-distribution-docker/src/main/docker/Dockerfile +++ b/packages/policy-distribution-docker/src/main/docker/Dockerfile @@ -4,23 +4,21 @@ LABEL maintainer="Policy Team" ARG POLICY_LOGS=/var/log/onap/policy/distribution -ENV POLICY_LOGS ${POLICY_LOGS} -ENV POLICY_DISTRIBUTION_HOME=${POLICY_HOME}/distribution +ENV POLICY_LOGS=$POLICY_LOGS +ENV POLICY_HOME=$POLICY_HOME/distribution -RUN mkdir -p ${POLICY_DISTRIBUTION_HOME} ${POLICY_LOGS} ${POLICY_DISTRIBUTION_HOME}/bin && \ - chown -R policy:policy ${POLICY_DISTRIBUTION_HOME} ${POLICY_LOGS} +RUN mkdir -p $POLICY_HOME $POLICY_LOGS $POLICY_HOME/bin && \ + chown -R policy:policy $POLICY_HOME $POLICY_LOGS RUN mkdir /packages COPY /maven/* /packages -RUN tar xvfz /packages/policy-distribution.tar.gz --directory ${POLICY_DISTRIBUTION_HOME} \ +RUN tar xvfz /packages/policy-distribution.tar.gz --directory $POLICY_HOME \ && rm /packages/policy-distribution.tar.gz -WORKDIR ${POLICY_DISTRIBUTION_HOME} +WORKDIR $POLICY_HOME COPY policy-dist.sh bin/. -RUN chown -R policy:policy * && chmod +x bin/*.sh \ - && cp ${POLICY_DISTRIBUTION_HOME}/etc/ssl/* ${POLICY_HOME}/etc/ssl \ - && chown policy:policy ${POLICY_HOME}/etc/ssl/* +RUN chown -R policy:policy * && chmod 755 bin/*.sh USER policy -WORKDIR ${POLICY_DISTRIBUTION_HOME}/bin +WORKDIR $POLICY_HOME/bin ENTRYPOINT [ "bash", "./policy-dist.sh" ] diff --git a/packages/policy-distribution-docker/src/main/docker/policy-dist.sh b/packages/policy-distribution-docker/src/main/docker/policy-dist.sh index 63879e3e..3a559f34 100644 --- a/packages/policy-distribution-docker/src/main/docker/policy-dist.sh +++ b/packages/policy-distribution-docker/src/main/docker/policy-dist.sh @@ -2,6 +2,7 @@ # # ============LICENSE_START======================================================= # Copyright (C) 2018 Ericsson. All rights reserved. +# Modifications Copyright (C) 2019 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +21,6 @@ # JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk/ -POLICY_DISTRIBUTION_HOME=/opt/app/policy/distribution KEYSTORE="${POLICY_HOME}/etc/ssl/policy-keystore" KEYSTORE_PASSWD="Pol1cy_0nap" TRUSTSTORE="${POLICY_HOME}/etc/ssl/policy-truststore" @@ -35,9 +35,9 @@ fi if [ -z "$CONFIG_FILE" ] then - CONFIG_FILE="$POLICY_DISTRIBUTION_HOME/etc/defaultConfig.json" + CONFIG_FILE="${POLICY_HOME}/etc/defaultConfig.json" fi echo "Policy distribution config file: $CONFIG_FILE" -$JAVA_HOME/bin/java -cp "$POLICY_DISTRIBUTION_HOME/etc:$POLICY_DISTRIBUTION_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.distribution.main.startstop.Main -c $CONFIG_FILE +$JAVA_HOME/bin/java -cp "${POLICY_HOME}/etc:${POLICY_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.distribution.main.startstop.Main -c $CONFIG_FILE |