From 7f7da1e1af9b4a273ce166984ba0113d6355f442 Mon Sep 17 00:00:00 2001 From: sandovalfr Date: Mon, 4 Mar 2019 12:17:58 -0500 Subject: small, multi-platform images Issue-ID: INT-886 Change-Id: I06532dc486641314c4c6e53f509a3d942ca44e52 Signed-off-by: sandovalfr --- dmaap-bc/misc/dmaapbc | 6 +- dmaap-bc/pom.xml | 235 +++++++++++++++++++++------------ dmaap-bc/src/main/resources/Dockerfile | 41 ++++++ 3 files changed, 199 insertions(+), 83 deletions(-) create mode 100644 dmaap-bc/src/main/resources/Dockerfile (limited to 'dmaap-bc') diff --git a/dmaap-bc/misc/dmaapbc b/dmaap-bc/misc/dmaapbc index f1e8ae7..76317d8 100644 --- a/dmaap-bc/misc/dmaapbc +++ b/dmaap-bc/misc/dmaapbc @@ -52,13 +52,15 @@ config() { echo "Expected app root directory $APP_ROOT does not exist" exit 1 fi + + cd $APP_ROOT if [ ! -f $CONTAINER_CONFIG ] then echo "WARNING: Expected env file $CONTAINER_CONFIG not found. Default behaviors in effect" find $CONTAINER_ROOT -type f + else + source $CONTAINER_CONFIG fi - cd $APP_ROOT - source $CONTAINER_CONFIG if [ "$DMAAPBC_WAIT_TO_EXIT" != "Y" ] then diff --git a/dmaap-bc/pom.xml b/dmaap-bc/pom.xml index f7f2bc1..e4b64ed 100644 --- a/dmaap-bc/pom.xml +++ b/dmaap-bc/pom.xml @@ -168,95 +168,165 @@ - - docker - - false - false - true - - - - - com.spotify - docker-maven-plugin - ${docker.maven.plugin.version} - - java:openjdk-8-jre - ${onap.nexus.dockerregistry.daily}/${docker.image} - ["./bin/dmaapbc", "deploy"] - ${onap.nexus.dockerregistry.daily} - false - - ${artifact.version} - latest - - - /opt/app/dmaapbc/log - - true - root - + + docker + + false + false + true + + + + - /opt/app/dmaapbc/lib - ${multiproject.basedir}/dmaap-bc/target - dmaap-bc.jar + ${basedir}/target/docker-stage + ${basedir}/src/main/resources + + Dockerfile + - - /opt/app/dmaapbc/etc - ${multiproject.basedir}/dmaap-bc/misc - LocalKey - logback.xml - org.onap.dmaap-bc.trust.jks - dbc-api.jks + + ${basedir}/target/docker-stage/opt/app/dmaapbc/etc + ${basedir}/misc + + LocalKey + logback.xml + org.onap.dmaap-bc.trust.jks + dbc-api.jks + - - /opt/app/dmaapbc/etc - ${multiproject.basedir}/dmaap-bc - version.properties + + ${basedir}/target/docker-stage/opt/app/dmaapbc/etc + ${basedir} + + version.properties + - - /opt/app/dmaapbc/misc - ${multiproject.basedir}/dmaap-bc/misc - opensource.env - *.tmpl + + ${basedir}/target/docker-stage/opt/app/dmaapbc/misc + ${basedir}/misc + + opensource.env + *.tmpl + - - /opt/app/dmaapbc/misc - ${multiproject.basedir}/misc - cert-client-init.sh + + ${basedir}/target/docker-stage/opt/app/dmaapbc/misc + ${multiproject.basedir}/misc + + cert-client-init.sh + - - /opt/app/dmaapbc/bin - ${multiproject.basedir}/dmaap-bc/misc - dmaapbc - doaction + + ${basedir}/target/docker-stage/opt/app/dmaapbc/bin + ${basedir}/misc + + dmaapbc + doaction + - - mv /opt/app/dmaapbc/etc/dbc-api.jks /opt/app/dmaapbc/etc/keystore - chmod 600 /opt/app/dmaapbc/etc/keystore - chmod 600 /opt/app/dmaapbc/etc/org.onap.dmaap-bc.trust.jks - chmod +x /opt/app/dmaapbc/misc/cert-client-init.sh - chmod +x /opt/app/dmaapbc/bin/* - mkdir /opt/app/dmaapbc/logs - mkdir /opt/app/dmaapbc/www - mkdir /opt/app/dmaapbc/www/doc - - /opt/app/dmaapbc - - - - default - - build - push - - - - - - + + + + maven-resources-plugin + 2.7 + + + copy-jar + package + + copy-resources + + + ${basedir}/target/docker-stage/opt/app/dmaapbc/lib + + + ${multiproject.basedir}/dmaap-bc/target + + dmaap-bc.jar + + + + + + + + + + + org.codehaus.groovy.maven + gmaven-plugin + + + validate + + execute + + + + ${project.version} + ${maven.build.timestamp} + + + println 'ver: ' + project.properties['ver']; + if ( project.properties['ver'].endsWith("-SNAPSHOT") ) { + project.properties['dockertag1']=project.properties['ver'] + "-latest"; + project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp']; + } else { + project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest"; + project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp']; + } + println 'docker tag 1: ' + project.properties['dockertag1']; + println 'docker tag 2: ' + project.properties['dockertag2']; + + + + + + + + io.fabric8 + docker-maven-plugin + 0.28.0 + + ${docker.verbose} + ${docker.apiVersion} + ${docker.pull.registry} + + + ${onap.nexus.dockerregistry.daily}/${docker.image} + + try + ${basedir}/target/docker-stage + Dockerfile + + ${dockertag1} + ${dockertag2} + + + + + + + + generate-images + install + + build + + + + push-images + deploy + + push + + + + + + @@ -401,6 +471,9 @@ https://nexus.onap.org 10.12.5.45:5000 + ${maven.build.timestamp} + yyyyMMdd'T'HHmmss'Z' + /content/sites/site/org/onap/dmaap/dmaap-bc/${artifact.version} diff --git a/dmaap-bc/src/main/resources/Dockerfile b/dmaap-bc/src/main/resources/Dockerfile new file mode 100644 index 0000000..16820e1 --- /dev/null +++ b/dmaap-bc/src/main/resources/Dockerfile @@ -0,0 +1,41 @@ +######### +# ============LICENSE_START==================================================== +# org.onap.dmaap +# =========================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Modifications Copyright (C) 2018 Nokia. 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. +# ============LICENSE_END==================================================== +# +FROM openjdk:8-jre-alpine + +MAINTAINER DMAAP Team + +COPY /opt /opt + +WORKDIR /opt/app/dmaapbc + +RUN mv etc/dbc-api.jks etc/keystore && \ + chmod 600 etc/keystore && \ + chmod 600 etc/org.onap.dmaap-bc.trust.jks && \ + chmod +x misc/cert-client-init.sh && \ + chmod +x bin/* && \ + mkdir logs && \ + mkdir www && \ + mkdir doc && \ + mkdir config + +VOLUME /opt/app/dmaapbc/log + +ENTRYPOINT ["sh", "./bin/dmaapbc", "deploy"] -- cgit 1.2.3-korg