From 91162610de8efaa9c0bfd73ff99fcabe0ef23e8a Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Sat, 9 Feb 2019 18:33:55 -0500 Subject: Multiple fixes & enhancement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rework docker image build - Fix compress function - Fix node type name for source-primary-db Change-Id: Ide38e17036e76047d9f850b714ba0da4add5cd9d Issue-ID: CCSDK-414 Signed-off-by: Alexis de Talhouët --- .../distribution/src/main/dc/docker-compose.yaml | 3 -- .../distribution/src/main/docker/Dockerfile | 17 ++++------ .../distribution/src/main/docker/distribution.xml | 38 +++++----------------- .../distribution/src/main/docker/run.source | 13 ++++++++ .../distribution/src/main/docker/startService.sh | 1 - 5 files changed, 28 insertions(+), 44 deletions(-) create mode 100755 ms/controllerblueprints/distribution/src/main/docker/run.source (limited to 'ms/controllerblueprints/distribution/src/main') diff --git a/ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml b/ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml index 232bfc01..450a3541 100755 --- a/ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml +++ b/ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml @@ -22,9 +22,6 @@ services: ports: - "8080:8080" restart: always - volumes: - - ~/share/vm_ms/controllerblueprints/config:/opt/app/onap/config - - ~/share/vm_ms/controllerblueprints/logs:/logs environment: APPLICATIONNAME: ControllerBluePrints BUNDLEVERSION: 1.0.0 diff --git a/ms/controllerblueprints/distribution/src/main/docker/Dockerfile b/ms/controllerblueprints/distribution/src/main/docker/Dockerfile index 88577f5a..d3e10b76 100755 --- a/ms/controllerblueprints/distribution/src/main/docker/Dockerfile +++ b/ms/controllerblueprints/distribution/src/main/docker/Dockerfile @@ -3,19 +3,16 @@ FROM anapsix/alpine-java:8_jdk ENV HTTP_PROXY ${HTTP_PROXY} ENV HTTPS_PROXY ${HTTPS_PROXY} -RUN apk add --no-cache curl - +# add entrypoint +COPY run.source /etc/run.source COPY startService.sh /startService.sh RUN chmod 777 /startService.sh && dos2unix /startService.sh +# add application COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz - -RUN (mkdir -p /source /opt/app/onap) && (tar -xzf /source.tar.gz -C /source) \ -&& (mv /source/@project.build.finalName@ /source/app) \ -&& (cp -rf /source/app/opt/app/onap/lib /opt/app/onap/) \ -&& (cp -rf /source/app/etc /) \ -&& (cp -rf /source/app/model-catalog /) \ -&& (cp -rf /source/app/config /) \ -&& (rm -rf /source) +RUN tar -xzf /source.tar.gz -C /tmp \ + && cp -rf /tmp/@project.build.finalName@/opt / \ + && rm -rf /source.tar.gz \ + && rm -rf /tmp/@project.build.finalName@ ENTRYPOINT /startService.sh \ No newline at end of file diff --git a/ms/controllerblueprints/distribution/src/main/docker/distribution.xml b/ms/controllerblueprints/distribution/src/main/docker/distribution.xml index 1555b43e..74dc4400 100755 --- a/ms/controllerblueprints/distribution/src/main/docker/distribution.xml +++ b/ms/controllerblueprints/distribution/src/main/docker/distribution.xml @@ -17,8 +17,8 @@ --> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd"> ${assembly.id} @@ -27,8 +27,6 @@ /opt/app/onap/lib - - @@ -36,38 +34,18 @@ ${project.basedir}/../application/src/main/resources application.properties + logback.xml - ./ - true - - - ${project.basedir}/src/main/docker - - Dockerfile - startService.sh - - ./ - true - - - ${project.basedir}/../application/src/main/resources - src/main/resources - true - - - ${project.basedir}/../application/etc - ./etc - true - - - ${project.basedir}/../application/opt/app/onap/config - ./config + /opt/app/onap/config true ${project.basedir}/../../../components/model-catalog - ./model-catalog + /opt/app/onap/model-catalog true + + ${project.basedir}/../../../components/model-catalog/proto-definition + diff --git a/ms/controllerblueprints/distribution/src/main/docker/run.source b/ms/controllerblueprints/distribution/src/main/docker/run.source new file mode 100755 index 00000000..1d0ac070 --- /dev/null +++ b/ms/controllerblueprints/distribution/src/main/docker/run.source @@ -0,0 +1,13 @@ +java -classpath "/etc:${APP_HOME}/lib/*:/lib/*:/src:/schema:/generated-sources:${APP_CONFIG_HOME}:${APP_HOME}" \ +-DappName=${APPLICATIONNAME} -DappVersion=${BUNDLEVERSION} \ +-DrouteOffer=${ROUTEOFFER} \ +-DVERSION_ROUTEOFFER_ENVCONTEXT=${BUNDLEVERSION}/${STICKYSELECTORKEY}/${ENVCONTEXT} \ +-DSecurityFilePath=/etc \ +-DREST_NAME_NORMALIZER_PATTERN_FILE=/etc/PatternInputs.txt \ +-Dms_name=org.onap.ccsdk.apps.controllerblueprints \ +-Dlogging.config=${APP_CONFIG_HOME}/logback.xml \ +-Djava.security.egd=file:/dev/./urandom \ +-DAPPNAME=${APP_NAME} -DAPPENV=${APP_ENV} -DAPPVERSION=${APP_VERSION} -DNAMESPACE=${NAMESPACE} \ +-Dspring.config.location=${APP_CONFIG_HOME}/ \ +-Dblueprints.load.initial-data=${INIT_DATA_LOAD} \ +org.onap.ccsdk.apps.controllerblueprints.ControllerBlueprintsApplication diff --git a/ms/controllerblueprints/distribution/src/main/docker/startService.sh b/ms/controllerblueprints/distribution/src/main/docker/startService.sh index 84b2e5ac..7077c224 100755 --- a/ms/controllerblueprints/distribution/src/main/docker/startService.sh +++ b/ms/controllerblueprints/distribution/src/main/docker/startService.sh @@ -5,5 +5,4 @@ nodeName=ControllerBlueprints_1.0.0_$(cat /proc/self/cgroup | grep docker | sed echo "APP Config HOME : ${APP_CONFIG_HOME}" export APP_HOME=/opt/app/onap -cp -rf /config /opt/app/onap/ source /etc/run.source -- cgit 1.2.3-korg