From 545a3ab71bc48b56d538bba3e0fb11a5e41b398f Mon Sep 17 00:00:00 2001 From: Steve Alphonse Siani Date: Mon, 21 Jan 2019 11:55:48 -0500 Subject: ControllerBlueprint blueprintsProcessor container Change-Id: I77df77757c276fca705091c1566c386f842269c4 Issue-ID: CCSDK-949 Signed-off-by: Steve Alphonse Siani --- ms/blueprintsprocessor/application/etc/logback.xml | 36 ++ ms/blueprintsprocessor/application/etc/run.source | 12 + .../opt/app/onap/config/application.properties | 36 ++ .../application/opt/app/onap/config/logback.xml | 36 ++ ms/blueprintsprocessor/application/pom.xml | 85 +++- .../src/main/resources/application-dev.properties | 36 ++ .../src/main/resources/application.properties | 7 +- .../src/test/resources/application.properties | 2 + ms/blueprintsprocessor/distribution/pom.xml | 196 +++++++++ .../distribution/src/main/dc/docker-compose.yaml | 33 ++ .../distribution/src/main/docker/Dockerfile | 20 + .../distribution/src/main/docker/distribution.xml | 69 +++ .../distribution/src/main/docker/startService.sh | 9 + ms/blueprintsprocessor/functions/pom.xml | 0 .../modules/commons/db-lib/pom.xml | 4 + ms/blueprintsprocessor/modules/commons/pom.xml | 2 + .../modules/commons/rest-lib/pom.xml | 4 + .../modules/inbounds/resource-api/pom.xml | 20 +- .../modules/inbounds/selfservice-api/pom.xml | 7 + ms/blueprintsprocessor/modules/outbounds/pom.xml | 20 +- .../modules/services/execution-service/pom.xml | 4 + ms/blueprintsprocessor/modules/services/pom.xml | 2 + .../modules/services/workflow-service/pom.xml | 4 + ms/blueprintsprocessor/parent/pom.xml | 11 + ms/blueprintsprocessor/pom.xml | 56 +-- ms/controllerblueprints/application/etc/run.source | 5 +- .../opt/app/onap/config/application-dev.properties | 5 +- .../opt/app/onap/config/application.properties | 22 +- .../application/opt/app/onap/config/logback.xml | 44 ++ .../controllerblueprints/ApplicationConstants.java | 2 +- .../ControllerBlueprintsApplication.java | 42 ++ .../ControllerBluprintsApplication.java | 42 -- .../src/main/resources/application-dev.properties | 70 +++ .../src/main/resources/application.properties | 74 ++++ .../ControllerBlueprintsApplicationTest.java | 62 +++ .../ControllerBluprintsApplicationTest.java | 62 --- .../src/test/resources/application.properties | 5 +- ms/controllerblueprints/distribution/pom.xml | 89 ++-- .../distribution/src/main/dc/docker-compose.yaml | 70 ++- .../distribution/src/main/docker/Dockerfile | 3 +- .../distribution/src/main/docker/distribution.xml | 6 + .../distribution/src/main/docker/startService.sh | 1 + ms/vlantag-api/pom.xml | 476 ++++++++++----------- 43 files changed, 1302 insertions(+), 489 deletions(-) create mode 100755 ms/blueprintsprocessor/application/etc/logback.xml create mode 100755 ms/blueprintsprocessor/application/etc/run.source create mode 100755 ms/blueprintsprocessor/application/opt/app/onap/config/application.properties create mode 100755 ms/blueprintsprocessor/application/opt/app/onap/config/logback.xml mode change 100644 => 100755 ms/blueprintsprocessor/application/pom.xml create mode 100755 ms/blueprintsprocessor/application/src/main/resources/application-dev.properties mode change 100644 => 100755 ms/blueprintsprocessor/application/src/main/resources/application.properties create mode 100755 ms/blueprintsprocessor/distribution/pom.xml create mode 100755 ms/blueprintsprocessor/distribution/src/main/dc/docker-compose.yaml create mode 100755 ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile create mode 100755 ms/blueprintsprocessor/distribution/src/main/docker/distribution.xml create mode 100755 ms/blueprintsprocessor/distribution/src/main/docker/startService.sh mode change 100644 => 100755 ms/blueprintsprocessor/functions/pom.xml mode change 100644 => 100755 ms/blueprintsprocessor/modules/commons/pom.xml mode change 100644 => 100755 ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml mode change 100644 => 100755 ms/blueprintsprocessor/modules/services/pom.xml mode change 100644 => 100755 ms/blueprintsprocessor/parent/pom.xml mode change 100644 => 100755 ms/blueprintsprocessor/pom.xml mode change 100644 => 100755 ms/controllerblueprints/application/etc/run.source create mode 100755 ms/controllerblueprints/application/opt/app/onap/config/logback.xml create mode 100644 ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBlueprintsApplication.java delete mode 100644 ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplication.java create mode 100755 ms/controllerblueprints/application/src/main/resources/application-dev.properties create mode 100755 ms/controllerblueprints/application/src/main/resources/application.properties create mode 100644 ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBlueprintsApplicationTest.java delete mode 100644 ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplicationTest.java mode change 100644 => 100755 ms/controllerblueprints/distribution/pom.xml mode change 100644 => 100755 ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml mode change 100644 => 100755 ms/controllerblueprints/distribution/src/main/docker/Dockerfile mode change 100644 => 100755 ms/controllerblueprints/distribution/src/main/docker/distribution.xml mode change 100644 => 100755 ms/controllerblueprints/distribution/src/main/docker/startService.sh (limited to 'ms') diff --git a/ms/blueprintsprocessor/application/etc/logback.xml b/ms/blueprintsprocessor/application/etc/logback.xml new file mode 100755 index 00000000..a97bb8c3 --- /dev/null +++ b/ms/blueprintsprocessor/application/etc/logback.xml @@ -0,0 +1,36 @@ + + + + + + + %d{HH:mm:ss.SSS} %-5level %logger{100} - %msg%n + + + + + + + + + + + + + + diff --git a/ms/blueprintsprocessor/application/etc/run.source b/ms/blueprintsprocessor/application/etc/run.source new file mode 100755 index 00000000..7557ab12 --- /dev/null +++ b/ms/blueprintsprocessor/application/etc/run.source @@ -0,0 +1,12 @@ +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.blueprintsprocessor \ +-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}/ \ +org.onap.ccsdk.apps.blueprintsprocessor.BlueprintProcessorApplication diff --git a/ms/blueprintsprocessor/application/opt/app/onap/config/application.properties b/ms/blueprintsprocessor/application/opt/app/onap/config/application.properties new file mode 100755 index 00000000..c4880b67 --- /dev/null +++ b/ms/blueprintsprocessor/application/opt/app/onap/config/application.properties @@ -0,0 +1,36 @@ +# +# Copyright � 2017-2018 AT&T Intellectual Property. +# Modifications Copyright © 2019 Bell Canada. +# +# 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. +# +#logging.level.web=DEBUG + +# Web server config +server.port=8080 + +blueprintsprocessor.grpcEnable=false +blueprintsprocessor.httpPort=8080 +blueprintsprocessor.grpcPort=9111 +# Blueprint Processor File Execution and Handling Properties +blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy +blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive +# Primary Database Configuration +blueprintsprocessor.db.primary.url=jdbc:mysql://db:3306/sdnctl +blueprintsprocessor.db.primary.username=sdnctl +blueprintsprocessor.db.primary.password=sdnctl +blueprintsprocessor.db.primary.driverClassName=org.mariadb.jdbc.Driver +blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=validate +blueprintsprocessor.db.primary.hibernateDDLAuto=none +blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy +blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.MySQL5InnoDBDialect \ No newline at end of file diff --git a/ms/blueprintsprocessor/application/opt/app/onap/config/logback.xml b/ms/blueprintsprocessor/application/opt/app/onap/config/logback.xml new file mode 100755 index 00000000..a97bb8c3 --- /dev/null +++ b/ms/blueprintsprocessor/application/opt/app/onap/config/logback.xml @@ -0,0 +1,36 @@ + + + + + + + %d{HH:mm:ss.SSS} %-5level %logger{100} - %msg%n + + + + + + + + + + + + + + diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml old mode 100644 new mode 100755 index 679a8b90..06752b79 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -3,6 +3,7 @@ ~ Copyright © 2017-2018 AT&T Intellectual Property. ~ ~ Modifications Copyright © 2018 IBM. + ~ Modifications Copyright © 2019 Bell Canada. ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -30,6 +31,10 @@ Blueprints Processor Application + + org.onap.ccsdk.apps.controllerblueprints + core + org.springframework.boot spring-boot-devtools @@ -69,13 +74,91 @@ test - + + + + ${basedir}/etc + ${basedir}/target/etc + true + + **/* + + + + + ${basedir}/src/main/resources + ${basedir}/target/src/main/resources + true + + **/* + + + + src/main/resources + + **/* + + true + + org.springframework.boot spring-boot-maven-plugin + + maven-resources-plugin + 2.6 + + + copy-dockerfile + + copy-resources + + validate + + ${basedir}/target/docker-stage + + + src/main/docker + + * + + true + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + ant-test + package + + + + + + + run + + + + + + maven-compiler-plugin + 3.1 + + + 1.8 + 1.8 + + diff --git a/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties b/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties new file mode 100755 index 00000000..6bfa2407 --- /dev/null +++ b/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties @@ -0,0 +1,36 @@ +# +# Copyright � 2017-2018 AT&T Intellectual Property. +# Modifications Copyright © 2019 IBM, Bell Canada. +# +# 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. +# +#logging.level.web=DEBUG + +# Web server config +server.port=8080 + +blueprintsprocessor.grpcEnable=false +blueprintsprocessor.httpPort=8080 +blueprintsprocessor.grpcPort=9111 +# Blueprint Processor File Execution and Handling Properties +blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy +blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive +# Primary Database Configuration +blueprintsprocessor.db.primary.url=jdbc:mysql://localhost:3306/sdnctl +blueprintsprocessor.db.primary.username=sdnctl +blueprintsprocessor.db.primary.password=sdnctl +blueprintsprocessor.db.primary.driverClassName=org.mariadb.jdbc.Driver +blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=update +blueprintsprocessor.db.primary.hibernateDDLAuto=none +blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy +blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.MySQL5InnoDBDialect \ No newline at end of file diff --git a/ms/blueprintsprocessor/application/src/main/resources/application.properties b/ms/blueprintsprocessor/application/src/main/resources/application.properties old mode 100644 new mode 100755 index fa1a1e6e..62695207 --- a/ms/blueprintsprocessor/application/src/main/resources/application.properties +++ b/ms/blueprintsprocessor/application/src/main/resources/application.properties @@ -1,5 +1,6 @@ # # Copyright � 2017-2018 AT&T Intellectual Property. +# Modifications Copyright © 2019 IBM, Bell Canada. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,6 +15,10 @@ # limitations under the License. # #logging.level.web=DEBUG + +# Web server config +server.port=8080 + blueprintsprocessor.grpcEnable=false blueprintsprocessor.httpPort=8080 blueprintsprocessor.grpcPort=9111 @@ -21,7 +26,7 @@ blueprintsprocessor.grpcPort=9111 blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive # Primary Database Configuration -blueprintsprocessor.db.primary.url=jdbc:mysql://localhost:3306/sdnctl +blueprintsprocessor.db.primary.url=jdbc:mysql://db:3306/sdnctl blueprintsprocessor.db.primary.username=sdnctl blueprintsprocessor.db.primary.password=sdnctl blueprintsprocessor.db.primary.driverClassName=org.mariadb.jdbc.Driver diff --git a/ms/blueprintsprocessor/application/src/test/resources/application.properties b/ms/blueprintsprocessor/application/src/test/resources/application.properties index f896ee05..d21264c0 100644 --- a/ms/blueprintsprocessor/application/src/test/resources/application.properties +++ b/ms/blueprintsprocessor/application/src/test/resources/application.properties @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# Web server config +server.port=8080 # Blueprint Processor File Execution and Handling Properties blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive diff --git a/ms/blueprintsprocessor/distribution/pom.xml b/ms/blueprintsprocessor/distribution/pom.xml new file mode 100755 index 00000000..fb5e3c12 --- /dev/null +++ b/ms/blueprintsprocessor/distribution/pom.xml @@ -0,0 +1,196 @@ + + + + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + parent + 0.4.1-SNAPSHOT + ../parent + + distribution + pom + Blueprints Processor Distribution + + maven + org.onap.ccsdk.apps + blueprintsprocessor + onap/ccsdk-blueprintsprocessor + ${https_proxy} + deploy + true + + + + + org.onap.ccsdk.apps.blueprintsprocessor + application + + + + + + maven-resources-plugin + 2.6 + + + copy-dockerfile + + copy-resources + + validate + + ${basedir}/target/docker-stage + + + src/main/docker + + * + + true + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + ant-test + package + + + + + + + run + + + + + + + maven-assembly-plugin + 3.1.0 + + + ${basedir}/target/docker-stage + + src/main/docker/distribution.xml + + posix + + + + ${assembly.id} + package + + single + + + + + + org.codehaus.groovy.maven + gmaven-plugin + 1.0 + + + validate + + execute + + + + println project.properties['ccsdk.project.version'] + def versionArray + if (project.properties['ccsdk.project.version'] != null ) { + versionArray = project.properties['ccsdk.project.version'].split('\\.') + } + + if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) + { + project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest" + } else { + project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest" + } + + println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'] + + + + + + + + + + + + docker + + + + io.fabric8 + docker-maven-plugin + 0.26.1 + false + + + + ${image.name} + + try + ${basedir}/target/docker-stage + + ${project.version} + ${project.version}-STAGING-${maven.build.timestamp} + ${project.docker.latesttag.version} + + + + + true + + + + generate-images + package + + build + + + + push-images + ${docker.push.phase} + + build + push + + + + + + + + + + \ No newline at end of file diff --git a/ms/blueprintsprocessor/distribution/src/main/dc/docker-compose.yaml b/ms/blueprintsprocessor/distribution/src/main/dc/docker-compose.yaml new file mode 100755 index 00000000..c0eade50 --- /dev/null +++ b/ms/blueprintsprocessor/distribution/src/main/dc/docker-compose.yaml @@ -0,0 +1,33 @@ +version: '3.3' + +services: + db: + image: mariadb:latest + container_name: ccsdk-mariadb + ports: + - "3306:3306" + volumes: + - ~/vm_mysql:/var/lib/mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: sdnctl + MYSQL_DATABASE: sdnctl + MYSQL_USER: sdnctl + MYSQL_PASSWORD: sdnctl + blueprints-processor: + depends_on: + - db + image: onap/ccsdk-blueprintsprocessor:latest + container_name: bp-rest + ports: + - "8000:8080" + restart: always + volumes: + - ~/share/vm_ms/blueprintsprocessor/config:/opt/app/onap/config + - ~/share/vm_ms/blueprintsprocessor/logs:/logs + environment: + APPLICATIONNAME: BlueprintsProcessor + BUNDLEVERSION: 1.0.0 + APP_CONFIG_HOME: /opt/app/onap/config + STICKYSELECTORKEY: + ENVCONTEXT: dev \ No newline at end of file diff --git a/ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile b/ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile new file mode 100755 index 00000000..21362329 --- /dev/null +++ b/ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile @@ -0,0 +1,20 @@ +FROM anapsix/alpine-java:8_jdk + +ENV HTTP_PROXY ${HTTP_PROXY} +ENV HTTPS_PROXY ${HTTPS_PROXY} + +RUN apk add --no-cache curl + +COPY startService.sh /startService.sh +RUN chmod 777 /startService.sh && dos2unix /startService.sh + +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/config /) \ +&& (rm -rf /source) + +ENTRYPOINT /startService.sh \ No newline at end of file diff --git a/ms/blueprintsprocessor/distribution/src/main/docker/distribution.xml b/ms/blueprintsprocessor/distribution/src/main/docker/distribution.xml new file mode 100755 index 00000000..b538b73b --- /dev/null +++ b/ms/blueprintsprocessor/distribution/src/main/docker/distribution.xml @@ -0,0 +1,69 @@ + + + + + + ${assembly.id} + + tar.gz + + + + /opt/app/onap/lib + ${artifact.groupId}-${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension} + + + + + + + ${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/opt/app/onap/config + ./config + true + + + ${project.basedir}/../application/etc + ./etc + true + + + \ No newline at end of file diff --git a/ms/blueprintsprocessor/distribution/src/main/docker/startService.sh b/ms/blueprintsprocessor/distribution/src/main/docker/startService.sh new file mode 100755 index 00000000..79bcbc06 --- /dev/null +++ b/ms/blueprintsprocessor/distribution/src/main/docker/startService.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +nodeName=BlueprintsProcessor_1.0.0_$(cat /proc/self/cgroup | grep docker | sed s/\\//\\n/g | tail -1) + +echo "APP Config HOME : ${APP_CONFIG_HOME}" +export APP_HOME=/opt/app/onap + +cp -rf /config /opt/app/onap/ +source /etc/run.source diff --git a/ms/blueprintsprocessor/functions/pom.xml b/ms/blueprintsprocessor/functions/pom.xml old mode 100644 new mode 100755 diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml index 53c9b185..590c87f0 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml @@ -28,6 +28,10 @@ Blueprints Processor DB Lib + + org.onap.ccsdk.apps.controllerblueprints + core + org.onap.ccsdk.apps.controllerblueprints db-resources diff --git a/ms/blueprintsprocessor/modules/commons/pom.xml b/ms/blueprintsprocessor/modules/commons/pom.xml old mode 100644 new mode 100755 index 4df89857..8d900a89 --- a/ms/blueprintsprocessor/modules/commons/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/pom.xml @@ -2,6 +2,8 @@ - 4.0.0 - - org.onap.ccsdk.apps.blueprintsprocessor - inbounds - 0.4.1-SNAPSHOT - + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + inbounds + 0.4.1-SNAPSHOT + - resource-api - jar - Blueprints Processor Resource API - Blueprints Processor Resource API + resource-api + jar + Blueprints Processor Resource API + Blueprints Processor Resource API diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml old mode 100644 new mode 100755 index c510734d..a15632b7 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -2,6 +2,8 @@ - 4.0.0 - - org.onap.ccsdk.apps.blueprintsprocessor - modules - 0.4.1-SNAPSHOT - + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + modules + 0.4.1-SNAPSHOT + - outbounds - pom - Blueprints Processor Outbounds POM - Blueprints Processor Outbounds + outbounds + pom + Blueprints Processor Outbounds POM + Blueprints Processor Outbounds diff --git a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml index 035f14d9..96bb09f2 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml @@ -28,6 +28,10 @@ Blueprints Processor Execution Service + + org.onap.ccsdk.apps.controllerblueprints + core + org.onap.ccsdk.apps.blueprintsprocessor core diff --git a/ms/blueprintsprocessor/modules/services/pom.xml b/ms/blueprintsprocessor/modules/services/pom.xml old mode 100644 new mode 100755 index 8cb3c6f1..469899d0 --- a/ms/blueprintsprocessor/modules/services/pom.xml +++ b/ms/blueprintsprocessor/modules/services/pom.xml @@ -2,6 +2,8 @@ + + org.onap.ccsdk.apps.blueprintsprocessor + application + ${project.version} + org.onap.ccsdk.apps.blueprintsprocessor db-lib @@ -304,6 +310,11 @@ resource-dict ${project.version} + + org.onap.ccsdk.apps.controllerblueprints + core + ${project.version} + diff --git a/ms/blueprintsprocessor/pom.xml b/ms/blueprintsprocessor/pom.xml old mode 100644 new mode 100755 index df4932cd..774e177e --- a/ms/blueprintsprocessor/pom.xml +++ b/ms/blueprintsprocessor/pom.xml @@ -1,6 +1,7 @@ - 4.0.0 - - org.onap.ccsdk.apps - ccsdk-apps-ms - 0.4.1-SNAPSHOT - - blueprintsprocessor - pom - Blueprints Processor Root - Blueprints Processor Root + 4.0.0 + + org.onap.ccsdk.apps + ccsdk-apps-ms + 0.4.1-SNAPSHOT + + blueprintsprocessor + pom + Blueprints Processor Root + Blueprints Processor Root - - BlueprintsProcessor - UTF-8 - UTF-8 - yyyyMMdd'T'HHmmss'Z' - ${maven.build.timestamp} - 1.8 - 1.8 - 1.8 - ${project.version} - + + BlueprintsProcessor + UTF-8 + UTF-8 + yyyyMMdd'T'HHmmss'Z' + ${maven.build.timestamp} + 1.8 + 1.8 + 1.8 + ${project.version} + - - parent - modules - functions - application - + + parent + modules + functions + application + distribution + diff --git a/ms/controllerblueprints/application/etc/run.source b/ms/controllerblueprints/application/etc/run.source old mode 100644 new mode 100755 index fc1b4e55..1d0ac070 --- a/ms/controllerblueprints/application/etc/run.source +++ b/ms/controllerblueprints/application/etc/run.source @@ -9,8 +9,5 @@ java -classpath "/etc:${APP_HOME}/lib/*:/lib/*:/src:/schema:/generated-sources:$ -Djava.security.egd=file:/dev/./urandom \ -DAPPNAME=${APP_NAME} -DAPPENV=${APP_ENV} -DAPPVERSION=${APP_VERSION} -DNAMESPACE=${NAMESPACE} \ -Dspring.config.location=${APP_CONFIG_HOME}/ \ --Dspring.datasource.url=${DB_URL} \ --Dspring.datasource.username=${DB_USER} \ --Dspring.datasource.password=${DB_PASSWORD} \ -Dblueprints.load.initial-data=${INIT_DATA_LOAD} \ -org.onap.ccsdk.apps.controllerblueprints.ControllerBluprintsApplication +org.onap.ccsdk.apps.controllerblueprints.ControllerBlueprintsApplication diff --git a/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties b/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties index 1a90df28..81b3061a 100755 --- a/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties +++ b/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties @@ -64,4 +64,7 @@ controllerblueprints.loadResourceDictionary=true controllerblueprints.loadResourceDictionaryPaths=./../../../components/model-catalog/resource-dictionary/starter-dictionary # CBA file extension -controllerblueprints.loadCbaExtension=zip \ No newline at end of file +controllerblueprints.loadCbaExtension=zip + +# Web server config +server.port=8080 \ No newline at end of file diff --git a/ms/controllerblueprints/application/opt/app/onap/config/application.properties b/ms/controllerblueprints/application/opt/app/onap/config/application.properties index 8d4dd581..5b651e66 100755 --- a/ms/controllerblueprints/application/opt/app/onap/config/application.properties +++ b/ms/controllerblueprints/application/opt/app/onap/config/application.properties @@ -1,6 +1,7 @@ # # Copyright © 2017-2018 AT&T Intellectual Property. # Modifications Copyright © 2018 IBM. +# Modifications Copyright © 2019 Bell Canada. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,14 +42,14 @@ spring.jpa.properties.hibernate.use_sql_comments=true spring.jpa.properties.hibernate.format_sql=true # spring.datasource.url, spring.datasource.username,spring.datasource.password may be overridden by ENV variables -spring.datasource.url=jdbc:mysql://localhost:3306/sdnctl +spring.datasource.url=jdbc:mysql://db:3306/sdnctl spring.datasource.username=sdnctl spring.datasource.password=sdnctl spring.datasource.driver-class-name=org.mariadb.jdbc.Driver -spring.jpa.show-sql = true -spring.jpa.hibernate.ddl-auto = none -spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy -spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect +spring.jpa.show-sql=true +spring.jpa.hibernate.ddl-auto=none +spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect # Load Resource Source Mappings resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability @@ -61,11 +62,14 @@ controllerblueprints.blueprintEnrichmentPath=/etc/blueprints/enrichment # blueprints.load.initial-data may be overridden by ENV variables controllerblueprints.loadInitialData=true controllerblueprints.loadBluePrint=false -controllerblueprints.loadBluePrintPaths=model-catalog/blueprint-model/starter-blueprint +controllerblueprints.loadBluePrintPaths=/model-catalog/blueprint-model/starter-blueprint controllerblueprints.loadModelType=true -controllerblueprints.loadModeTypePaths=model-catalog/definition-type/starter-type +controllerblueprints.loadModeTypePaths=/model-catalog/definition-type/starter-type controllerblueprints.loadResourceDictionary=true -controllerblueprints.loadResourceDictionaryPaths=model-catalog/resource-dictionary/starter-dictionary +controllerblueprints.loadResourceDictionaryPaths=/model-catalog/resource-dictionary/starter-dictionary # CBA file extension -controllerblueprints.loadCbaExtension=zip \ No newline at end of file +controllerblueprints.loadCbaExtension=zip + +# Web server config +server.port=8080 \ No newline at end of file diff --git a/ms/controllerblueprints/application/opt/app/onap/config/logback.xml b/ms/controllerblueprints/application/opt/app/onap/config/logback.xml new file mode 100755 index 00000000..01ae4f6c --- /dev/null +++ b/ms/controllerblueprints/application/opt/app/onap/config/logback.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + ${defaultPattern} + + + + + + + + + + + + + + + diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ApplicationConstants.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ApplicationConstants.java index 2471bd5b..c4759b56 100644 --- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ApplicationConstants.java +++ b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ApplicationConstants.java @@ -17,7 +17,7 @@ package org.onap.ccsdk.apps.controllerblueprints; /** - * ApplicationConstants.java Purpose: Provide ControllerBluprintsApplication Constant Information + * ApplicationConstants.java Purpose: Provide ControllerBlueprintsApplication Constant Information * * @author Brinda Santh * @version 1.0 diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBlueprintsApplication.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBlueprintsApplication.java new file mode 100644 index 00000000..e925c69c --- /dev/null +++ b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBlueprintsApplication.java @@ -0,0 +1,42 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * 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. + */ + +package org.onap.ccsdk.apps.controllerblueprints; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.web.reactive.config.EnableWebFlux; + +/** + * @author Brinda Santh + */ +@SpringBootApplication +@EnableWebFlux +@ComponentScan(basePackages = {"org.onap.ccsdk.apps.controllerblueprints"}) +@EnableAutoConfiguration +public class ControllerBlueprintsApplication { + private static EELFLogger log = EELFManager.getInstance().getLogger(ControllerBlueprintsApplication.class); + + public static void main(String[] args) { + log.info("****** Starting Controlled Blueprints Application ******"); + SpringApplication.run(ControllerBlueprintsApplication.class, args); + } + +} \ No newline at end of file diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplication.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplication.java deleted file mode 100644 index 6b0efd87..00000000 --- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplication.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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. - */ - -package org.onap.ccsdk.apps.controllerblueprints; - -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.reactive.config.EnableWebFlux; - -/** - * @author Brinda Santh - */ -@SpringBootApplication -@EnableWebFlux -@ComponentScan(basePackages = {"org.onap.ccsdk.apps.controllerblueprints"}) -@EnableAutoConfiguration -public class ControllerBluprintsApplication { - private static EELFLogger log = EELFManager.getInstance().getLogger(ControllerBluprintsApplication.class); - - public static void main(String[] args) { - log.info("****** Starting Controlled Blueprints Application ******"); - SpringApplication.run(ControllerBluprintsApplication.class, args); - } - -} \ No newline at end of file diff --git a/ms/controllerblueprints/application/src/main/resources/application-dev.properties b/ms/controllerblueprints/application/src/main/resources/application-dev.properties new file mode 100755 index 00000000..30b71fb4 --- /dev/null +++ b/ms/controllerblueprints/application/src/main/resources/application-dev.properties @@ -0,0 +1,70 @@ +# +# Copyright © 2017-2018 AT&T Intellectual Property. +# +# 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. +# +appName=ControllerBluePrints +ms_name=org.onap.ccsdk.apps.controllerblueprints +appVersion=1.0.0 + +# Basic Authentication +basic-auth.user-name=ccsdkapps +basic-auth.hashed-pwd={bcrypt}$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y + +#logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex + +logging.level.org.springframework.web=INFO +logging.level.org.hibernate.SQL=warn +logging.level.org.hibernate.type.descriptor.sql=debug + +#To Remove Null in JSON API Response +spring.jackson.default-property-inclusion=non_null + +#Swagger Configuration +swagger.contact.name=Brinda Santh Muthuramalingam +swagger.contact.url=www.onap.com +swagger.contact.email=brindasanth@onap.com + +spring.jpa.properties.hibernate.show_sql=true +spring.jpa.properties.hibernate.use_sql_comments=true +spring.jpa.properties.hibernate.format_sql=true + +# spring.datasource.url, spring.datasource.username,spring.datasource.password may be overridden by ENV variables +spring.datasource.url=jdbc:mysql://localhost:3306/sdnctl +spring.datasource.username=sdnctl +spring.datasource.password=sdnctl +spring.datasource.driver-class-name=org.mariadb.jdbc.Driver +spring.jpa.show-sql=true +spring.jpa.hibernate.ddl-auto=none +spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect +# Load Resource Source Mappings +resourceSourceMappings=db=source-db,input=source-input,default=source-default,mdsal=source-rest,capability=source-capability +# Controller Blueprints Core Configuration +controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy +controllerblueprints.blueprintArchivePath=/etc/blueprints/archive +controllerblueprints.blueprintEnrichmentPath=/etc/blueprints/enrichment +# Controller Blueprint Load Configurations +controllerblueprints.loadInitialData=true +controllerblueprints.loadBluePrint=false +controllerblueprints.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/starter-blueprint +controllerblueprints.loadModelType=true +controllerblueprints.loadModeTypePaths=./../../../components/model-catalog/definition-type/starter-type +controllerblueprints.loadResourceDictionary=true +controllerblueprints.loadResourceDictionaryPaths=./../../../components/model-catalog/resource-dictionary/starter-dictionary + +# CBA file extension +controllerblueprints.loadCbaExtension=zip + +# Web server config +server.port=8080 \ No newline at end of file diff --git a/ms/controllerblueprints/application/src/main/resources/application.properties b/ms/controllerblueprints/application/src/main/resources/application.properties new file mode 100755 index 00000000..b6d509ce --- /dev/null +++ b/ms/controllerblueprints/application/src/main/resources/application.properties @@ -0,0 +1,74 @@ +# +# Copyright © 2017-2018 AT&T Intellectual Property. +# Modifications Copyright © 2019 Bell Canada. +# +# 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. +# +appName=ControllerBluePrints +ms_name=org.onap.ccsdk.apps.controllerblueprints +appVersion=1.0.0 + +# Basic Authentication +basic-auth.user-name=ccsdkapps +basic-auth.hashed-pwd={bcrypt}$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y + +#logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex + +logging.level.org.springframework.web=INFO +logging.level.org.hibernate.SQL=warn +logging.level.org.hibernate.type.descriptor.sql=debug + +#To Remove Null in JSON API Response +spring.jackson.default-property-inclusion=non_null + +#Swagger Configuration +swagger.contact.name=Brinda Santh Muthuramalingam +swagger.contact.url=www.onap.com +swagger.contact.email=brindasanth@onap.com + +spring.jpa.properties.hibernate.show_sql=true +spring.jpa.properties.hibernate.use_sql_comments=true +spring.jpa.properties.hibernate.format_sql=true + +# spring.datasource.url, spring.datasource.username,spring.datasource.password may be overridden by ENV variables +spring.datasource.url=jdbc:mysql://db:3306/sdnctl +spring.datasource.username=sdnctl +spring.datasource.password=sdnctl +spring.datasource.driver-class-name=org.mariadb.jdbc.Driver +spring.jpa.show-sql=true +spring.jpa.hibernate.ddl-auto=none +spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect + +# Load Resource Source Mappings +resourceSourceMappings=db=source-db,input=source-input,default=source-default,mdsal=source-rest,capability=source-capability + +# Controller Blueprints Core Configuration +controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy +controllerblueprints.blueprintArchivePath=/etc/blueprints/archive +controllerblueprints.blueprintEnrichmentPath=/etc/blueprints/enrichment +# Controller Blueprint Load Configurations +# blueprints.load.initial-data may be overridden by ENV variables +controllerblueprints.loadInitialData=true +controllerblueprints.loadBluePrint=false +controllerblueprints.loadBluePrintPaths=/model-catalog/blueprint-model/starter-blueprint +controllerblueprints.loadModelType=true +controllerblueprints.loadModeTypePaths=/model-catalog/definition-type/starter-type +controllerblueprints.loadResourceDictionary=true +controllerblueprints.loadResourceDictionaryPaths=/model-catalog/resource-dictionary/starter-dictionary + +# CBA file extension +controllerblueprints.loadCbaExtension=zip + +# Web server config +server.port=8080 \ No newline at end of file diff --git a/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBlueprintsApplicationTest.java b/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBlueprintsApplicationTest.java new file mode 100644 index 00000000..cf9b3e71 --- /dev/null +++ b/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBlueprintsApplicationTest.java @@ -0,0 +1,62 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * 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. + */ + +package org.onap.ccsdk.apps.controllerblueprints; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.http.client.support.BasicAuthorizationInterceptor; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) +public class ControllerBlueprintsApplicationTest { + @Autowired + private TestRestTemplate restTemplate; + + @Before + public void setUp(){ + BasicAuthorizationInterceptor bai = new BasicAuthorizationInterceptor("ccsdkapps", "ccsdkapps"); + this.restTemplate.getRestTemplate().getInterceptors().add(bai); + } + + @Test + public void testConfigModel() { + HttpHeaders headers = new HttpHeaders(); + headers.set("Accept", MediaType.APPLICATION_JSON_VALUE); +// ResponseEntity entity = this.restTemplate +// .exchange("/api/v1/config-model/1", HttpMethod.GET, new HttpEntity<>(headers),BlueprintModel.class); +// assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); +// Assert.assertNotNull("failed to get response Config model",entity.getBody()); + } + + @Test + public void testConfigModelFailure() { + HttpHeaders headers = new HttpHeaders(); + headers.set("Accept", MediaType.APPLICATION_JSON_VALUE); +// ResponseEntity entity = this.restTemplate +// .exchange("/api/v1/config-model-not-found/1", HttpMethod.GET, new HttpEntity<>(headers),BlueprintModel.class); +// assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); +// Assert.assertNotNull("failed to get response Config model",entity.getBody()); + } +} diff --git a/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplicationTest.java b/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplicationTest.java deleted file mode 100644 index 969f8042..00000000 --- a/ms/controllerblueprints/application/src/test/java/org/onap/ccsdk/apps/controllerblueprints/ControllerBluprintsApplicationTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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. - */ - -package org.onap.ccsdk.apps.controllerblueprints; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.http.client.support.BasicAuthorizationInterceptor; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) -public class ControllerBluprintsApplicationTest { - @Autowired - private TestRestTemplate restTemplate; - - @Before - public void setUp(){ - BasicAuthorizationInterceptor bai = new BasicAuthorizationInterceptor("ccsdkapps", "ccsdkapps"); - this.restTemplate.getRestTemplate().getInterceptors().add(bai); - } - - @Test - public void testConfigModel() { - HttpHeaders headers = new HttpHeaders(); - headers.set("Accept", MediaType.APPLICATION_JSON_VALUE); -// ResponseEntity entity = this.restTemplate -// .exchange("/api/v1/config-model/1", HttpMethod.GET, new HttpEntity<>(headers),BlueprintModel.class); -// assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); -// Assert.assertNotNull("failed to get response Config model",entity.getBody()); - } - - @Test - public void testConfigModelFailure() { - HttpHeaders headers = new HttpHeaders(); - headers.set("Accept", MediaType.APPLICATION_JSON_VALUE); -// ResponseEntity entity = this.restTemplate -// .exchange("/api/v1/config-model-not-found/1", HttpMethod.GET, new HttpEntity<>(headers),BlueprintModel.class); -// assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); -// Assert.assertNotNull("failed to get response Config model",entity.getBody()); - } -} diff --git a/ms/controllerblueprints/application/src/test/resources/application.properties b/ms/controllerblueprints/application/src/test/resources/application.properties index 13b2aa75..9aebd793 100755 --- a/ms/controllerblueprints/application/src/test/resources/application.properties +++ b/ms/controllerblueprints/application/src/test/resources/application.properties @@ -52,4 +52,7 @@ controllerblueprints.loadResourceDictionaryPaths=./../../../../components/model- controllerblueprints.loadCbaExtension=zip # CBA examples for tests cases -controllerblueprints.loadBlueprintsExamplesPath=./../../../../components/model-catalog/blueprint-model/test-blueprints \ No newline at end of file +controllerblueprints.loadBlueprintsExamplesPath=./../../../../components/model-catalog/blueprint-model/test-blueprints + +# Web server config +server.port=8080 \ No newline at end of file diff --git a/ms/controllerblueprints/distribution/pom.xml b/ms/controllerblueprints/distribution/pom.xml old mode 100644 new mode 100755 index 30571293..91d4bbca --- a/ms/controllerblueprints/distribution/pom.xml +++ b/ms/controllerblueprints/distribution/pom.xml @@ -1,6 +1,7 @@ controllerblueprints onap/ccsdk-controllerblueprints - ${https_proxy} - deploy - true - + ${https_proxy} + deploy + true + @@ -120,20 +121,20 @@ - println project.properties['ccsdk.project.version']; - def versionArray; + println project.properties['ccsdk.project.version'] + def versionArray if (project.properties['ccsdk.project.version'] != null ) { - versionArray = project.properties['ccsdk.project.version'].split('\\.'); + versionArray = project.properties['ccsdk.project.version'].split('\\.') } if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) { - project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; + project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest" } else { - project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest"; + project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest" } - println 'New Tag for docker:' + project.properties['project.docker.latesttag.version']; + println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'] @@ -143,34 +144,34 @@ - - - docker - - - - io.fabric8 - docker-maven-plugin - 0.26.1 - false - - - - ${image.name} - - try - ${basedir}/target/docker-stage - - ${project.version} - ${project.version}-STAGING-${maven.build.timestamp} - ${project.docker.latesttag.version} - - - - - true - - + + + docker + + + + io.fabric8 + docker-maven-plugin + 0.26.1 + false + + + + ${image.name} + + try + ${basedir}/target/docker-stage + + ${project.version} + ${project.version}-STAGING-${maven.build.timestamp} + ${project.docker.latesttag.version} + + + + + true + + generate-images package @@ -186,11 +187,11 @@ push - - - - - + + + + + - + diff --git a/ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml b/ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml old mode 100644 new mode 100755 index eae24703..232bfc01 --- a/ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml +++ b/ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml @@ -1,37 +1,33 @@ -version: '3.3' - -services: - db: - image: mariadb:latest - container_name: cb-mariadb - ports: - - "3306:3306" - volumes: - - ~/vm_mysql:/var/lib/mysql - restart: always - environment: - MYSQL_ROOT_PASSWORD: sdnctl - MYSQL_DATABASE: sdnctl - MYSQL_USER: sdnctl - MYSQL_PASSWORD: sdnctl - controller-blueprints: - depends_on: - - db - image: onap/ccsdk-controllerblueprints:latest - container_name: cb-rest - 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 - APP_CONFIG_HOME: /opt/app/onap/config - DB_URL: jdbc:mysql://db:3306/sdnctl - DB_USER: sdnctl - DB_PASSWORD: sdnctl - INIT_DATA_LOAD: "true" - STICKYSELECTORKEY: - ENVCONTEXT: DEV \ No newline at end of file +version: '3.3' + +services: + db: + image: mariadb:latest + container_name: ccsdk-mariadb + ports: + - "3306:3306" + volumes: + - ~/vm_mysql:/var/lib/mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: sdnctl + MYSQL_DATABASE: sdnctl + MYSQL_USER: sdnctl + MYSQL_PASSWORD: sdnctl + controller-blueprints: + depends_on: + - db + image: onap/ccsdk-controllerblueprints:latest + container_name: cb-rest + 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 + APP_CONFIG_HOME: /opt/app/onap/config + STICKYSELECTORKEY: + ENVCONTEXT: dev \ No newline at end of file diff --git a/ms/controllerblueprints/distribution/src/main/docker/Dockerfile b/ms/controllerblueprints/distribution/src/main/docker/Dockerfile old mode 100644 new mode 100755 index 6de589da..88577f5a --- a/ms/controllerblueprints/distribution/src/main/docker/Dockerfile +++ b/ms/controllerblueprints/distribution/src/main/docker/Dockerfile @@ -15,6 +15,7 @@ RUN (mkdir -p /source /opt/app/onap) && (tar -xzf /source.tar.gz -C /source) \ && (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) -ENTRYPOINT /startService.sh +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 old mode 100644 new mode 100755 index c929f98e..1555b43e --- a/ms/controllerblueprints/distribution/src/main/docker/distribution.xml +++ b/ms/controllerblueprints/distribution/src/main/docker/distribution.xml @@ -1,6 +1,7 @@ - jacoco - reuseReports - ${basedir}/target/surefire-reports - ${basedir}/target/failsafe-reports - ${basedir}/target/jacoco_report - ${basedir}/target/jacoco_itReport - ${basedir}/target/jacoco-ut.exec - ${basedir}/target/jacoco-it.exec - java - 2.0.7 - ${https_proxy} - deploy - true - ${project.version} - + + jacoco + reuseReports + ${basedir}/target/surefire-reports + ${basedir}/target/failsafe-reports + ${basedir}/target/jacoco_report + ${basedir}/target/jacoco_itReport + ${basedir}/target/jacoco-ut.exec + ${basedir}/target/jacoco-it.exec + java + 2.0.7 + ${https_proxy} + deploy + true + ${project.version} + - - org.onap.ccsdk.parent - spring-boot-starter-parent - 1.2.1-SNAPSHOT - - + + org.onap.ccsdk.parent + spring-boot-starter-parent + 1.2.1-SNAPSHOT + + - - - org.springframework.boot - spring-boot-starter-jersey - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-test - test - + + + org.springframework.boot + spring-boot-starter-jersey + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + - - org.springframework.boot - spring-boot-starter-actuator - + + org.springframework.boot + spring-boot-starter-actuator + - - org.springframework.boot - spring-boot-starter-security - 2.0.1.RELEASE - + + org.springframework.boot + spring-boot-starter-security + 2.0.1.RELEASE + - - org.onap.ccsdk.sli.core - sli-common - ${ccsdk.sli.core.version} - provided - - - org.onap.ccsdk.sli.adaptors - resource-assignment-provider - ${ccsdk.sli.adaptors.version} - - - org.slf4j - slf4j-simple - - - + + org.onap.ccsdk.sli.core + sli-common + ${ccsdk.sli.core.version} + provided + + + org.onap.ccsdk.sli.adaptors + resource-assignment-provider + ${ccsdk.sli.adaptors.version} + + + org.slf4j + slf4j-simple + + + - - org.mariadb.jdbc - mariadb-java-client - ${mariadb.connector.version} - + + org.mariadb.jdbc + mariadb-java-client + ${mariadb.connector.version} + - - io.swagger - swagger-annotations - 1.5.8 - - + + io.swagger + swagger-annotations + 1.5.8 + + - - + + org.codehaus.groovy.maven gmaven-plugin @@ -136,7 +136,7 @@ - + org.apache.maven.plugins maven-surefire-plugin @@ -147,154 +147,154 @@ - - org.jacoco - jacoco-maven-plugin - 0.7.5.201505241946 - - - - pre-unit-test - - prepare-agent - - - - ${sonar.jacoco.reportPath} - surefireArgLine - - - - - post-unit-test - test - - report - - - - ${sonar.jacoco.reportPath} - - ${jacoco.path} - - - - - - com.github.kongchen - swagger-maven-plugin - 3.1.7 - - - - - http - https - - localhost:9091 - - org.onap.ccsdk.apps.ms.vlantagapi.core.service - org.onap.ccsdk.apps.ms.vlantagapi.core.model - - - /vlantagapi - - ${project.artifactId} Service - ${project.version} - - - - basicAuth - basic - - - ${swagger.directory} - - - - - - - package - - generate - - - - - - com.spotify - docker-maven-plugin - 0.4.11 - - ${docker.registry}/org.onap.ccsdk.apps/${serviceArtifactName} - src/main/docker - docker-hub - https://${docker.registry} - - ${project.version} - latest - - true - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${springboot.version} - - - - repackage - - - - - - + + org.jacoco + jacoco-maven-plugin + 0.7.5.201505241946 + + + + pre-unit-test + + prepare-agent + + + + ${sonar.jacoco.reportPath} + surefireArgLine + + + + + post-unit-test + test + + report + + + + ${sonar.jacoco.reportPath} + + ${jacoco.path} + + + + + + com.github.kongchen + swagger-maven-plugin + 3.1.7 + + + + + http + https + + localhost:9091 + + org.onap.ccsdk.apps.ms.vlantagapi.core.service + org.onap.ccsdk.apps.ms.vlantagapi.core.model + + + /vlantagapi + + ${project.artifactId} Service + ${project.version} + + + + basicAuth + basic + + + ${swagger.directory} + + + + + + + package + + generate + + + + + + com.spotify + docker-maven-plugin + 0.4.11 + + ${docker.registry}/org.onap.ccsdk.apps/${serviceArtifactName} + src/main/docker + docker-hub + https://${docker.registry} + + ${project.version} + latest + + true + + + / + ${project.build.directory} + ${project.build.finalName}.jar + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${springboot.version} + + + + repackage + + + + + + - - - docker - - - - com.spotify - docker-maven-plugin - 0.4.11 - - ${docker.registry}/org.onap.ccsdk.apps/${serviceArtifactName} - src/main/docker - docker-hub - https://${docker.registry} - - ${project.version} - ${project.version}-STAGING-${maven.build.timestamp} - ${project.docker.latesttag.version} - - true - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - - - - - - + + + docker + + + + com.spotify + docker-maven-plugin + 0.4.11 + + ${docker.registry}/org.onap.ccsdk.apps/${serviceArtifactName} + src/main/docker + docker-hub + https://${docker.registry} + + ${project.version} + ${project.version}-STAGING-${maven.build.timestamp} + ${project.docker.latesttag.version} + + true + + + / + ${project.build.directory} + ${project.build.finalName}.jar + + + + + + + + -- cgit 1.2.3-korg