Multiple fixes & enhancement
authorAlexis de Talhouët <adetalhouet89@gmail.com>
Sat, 9 Feb 2019 23:33:55 +0000 (18:33 -0500)
committerAlexis de Talhouët <adetalhouet89@gmail.com>
Tue, 12 Feb 2019 18:02:59 +0000 (13:02 -0500)
- 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 <adetalhouet89@gmail.com>
16 files changed:
ms/controllerblueprints/application/etc/SecurityFilterExpressions.cfg [deleted file]
ms/controllerblueprints/application/etc/SecurityFilterExpressionsPool.properties [deleted file]
ms/controllerblueprints/application/etc/logback.xml [deleted file]
ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties [deleted file]
ms/controllerblueprints/application/opt/app/onap/config/application.properties [deleted file]
ms/controllerblueprints/application/src/main/resources/application-dev.properties
ms/controllerblueprints/application/src/main/resources/application.properties
ms/controllerblueprints/application/src/main/resources/logback.xml [moved from ms/controllerblueprints/application/opt/app/onap/config/logback.xml with 97% similarity, mode: 0644]
ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml
ms/controllerblueprints/distribution/src/main/docker/Dockerfile
ms/controllerblueprints/distribution/src/main/docker/distribution.xml
ms/controllerblueprints/distribution/src/main/docker/run.source [moved from ms/controllerblueprints/application/etc/run.source with 100% similarity]
ms/controllerblueprints/distribution/src/main/docker/startService.sh
ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintArchiveUtils.kt
ms/controllerblueprints/modules/db-resources/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/db/resources/BlueprintCatalogServiceImpl.kt
ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/load/BluePrintCatalogLoadService.kt

diff --git a/ms/controllerblueprints/application/etc/SecurityFilterExpressions.cfg b/ms/controllerblueprints/application/etc/SecurityFilterExpressions.cfg
deleted file mode 100644 (file)
index 8185daa..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-(>)\d{3,4}(<\/.*security>) $1xxxx$2
-(>)\d{11,12}(\d{4}<\/.*creditCardNumber>) $1xxxxxxxxxxxx$2
-(>)\d+(\d{4}<\/.*socialSecurityNumber.*>) $1xxxxx$2
-(>)\d{5}(\d{4}<\/.*ssn>) $1xxxxx$2
-(>)\d*(\d{3}<\/.*idNumber>) $1xxxxxx$2
-(>)\d{11,12}(\d{4}<\/cardNumber>) $1xxxxxxxxxxxx$2
-(>)[^>]*(<\/[^>]*[pP]assword>) $1xxxxxx$2
-(>)\d{3,4}(<\/cvv>) $1xxx$2
-(Card\sNumber\s=\s)\d{11,12}(\d{4}) $1xxxxxxxxxxxx$2
-(CVV\s=\s)... $1xxx
-(SSN\s=\s)\d{9} $1xxxxxxxxx
-(>)\d{11,12}(\d{4}<\/ccNum>) $1xxxxxxxxxxxx$2
-(>)\d{3,4}(<\/cvvNumber>) $1xxx$2
-(ccNum\s*=\s*)\d{11,12}(\d{4}) $1xxxxxxxxxxxx$2
-(cvvNumber\s*=\s*)\d{3,4} $1xxx$2
-(>).*(<\/passcode>) $1xxxxxx$2
-(password\s*=\s*)\S+ $1xxxxxx
-(>)\d{5}(\d{4}<\/.*businessTaxId>) $1xxxxx$2
-(tax_id\sin\srecord=\s)\d{5}(\d{4}) $1xxxxx$2
-(tax_id\sin\srequest=\s)\d{5}(\d{4}) $1xxxxx$2
-(socialSecurityNumber\s*=\s*)\d+(\d{4}) $1xxxxx$2
-(SSN\sin\srecord=)\d+(\d{4}) $1xxxxx$2
-(ssn7\s*)\d+(\d{4}) $1xxxxx$2
-(>)\d+(\d{4}<\/cam:taxId>) $1xxxxx$2
-(>)\d+(\d{4}<\/.*routingNumber>) $1xxxxx$2
-(>)\d+(\d{4}<\/bankTRN>) $1xxxxx$2
-(>)\d+(\d{4}<\/draftAccount>) $1xxxxx$2
-(SSN\sin\srequest\s=)\d+(\d{4}) $1xxxxx$2
-(Input\sto\sCasTux\sCtrl:\sSSN\s)\d+(\d{4}) $1xxxxx$2
-(businessTaxId\s)\d+(\d{4}) $1xxxxx$2
-(InquireSingleCredit\sTax_ID_Input\sin\sresponse=\s)\d+(\d{4}) $1xxxxx$2
-(<com:ssNumber>)\d+(\d{4}<\/com:ssNumber>) $1xxxxx$2
-(SsNumber:\s)\d+(\d{4}) $1xxxxx$2
-(BusinessTaxId:\s)\d+(\d{4}) $1xxxxx$2
-(<acc:passcode>).*(<\/acc:passcode>) $1xxxxxx$2
-(>)\d{4}(<\/.*creditCardExpirationDate>) $1xxxx$2
-(birthDate>)\d+(-)\d+(-)\d+(<\/.*birthDate>) $1xxxx$2xx$3xx$4
-(photoIdNumber>)\d+(\d{4}<\/.*photoIdNumber) $1xxxxxxxxxxxxxxx$2
-(socialSecurityNumber>)\d+(\d{4}<\/.*socialSecurityNumber) $1xxxxx$2
-(cardExpirationDate>)\d+(-)\d+(-)\d+(<\/.*cardExpirationDate>) $1xxxx$2xx$3xx$4
-(securityCode>)\d+(<\/.*securityCode>) $1xxxx$2
-(photo_id_nbr>)\d+(\d{4}<\/.*photo_id_nbr) $1xxxxxxxxxxxxxxx$2
-(social_security_nbr>)\d+(\d{4}<\/.*social_security_nbr) $1xxxxx$2
-(birth_date>)\d+(/)\d+(/)\d+(<\/.*birth_date>) $1xx$2xx$3xxxx$4
-(dateOfBirth>)\d+(/)\d+(/)\d+(<\/.*dateOfBirth>) $1xx$2xx$3xxxx$4
-(dateOfBirth>)\d+(-)\d+(-)\d+(<\/.*dateOfBirth>) $1xxxx$2xx$3xx$4
-(dateOfBirth>)\d+(-)\d+(-)\d+(Z<\/.*dateOfBirth>) $1xxxx$2xx$3xx$4
-(dateOfBirth>)\d+(/)\d+(/)\d+(Z<\/.*dateOfBirth>) $1xx$2xx$3xxxx$4
-(>)\w*(\w{3}<\/.*idNumber>) $1xxxxxx$2
-(taxId>)\d+(\d{4}<\/.*taxId>) $1xxxxx$2
-(accountNumber>)\d{12,19}(\d{4}<\/.*accountNumber>) $1xxxxxxxxxxxxxxx$2
-(>)[^>]*(<\/[^>]*ethnicity>) $1xxxxxx$2
-(>)[^>]*(<\/[^>]*RACE>) $1x$2
-(>)[^>]*(<\/[^>]*minority>) $1x$2
-(>)[^>]*(<\/[^>]*MINORITY>) $1x$2
-(BIRTH_DATE>)\d+(-)\d+(-)\d+(<\/.*BIRTH_DATE>) $1xx$2xx$3xxxx$4
-(custom07>)\d+(-)\d+(-)\d+(<\/.*custom07>) $1xx$2xx$3xxxx$4
-(&gt;)\d{11,12}(\d{4}&lt;\/.*creditCardNumber&gt;) $1xxxxxxxxxxxx$2
-(&gt;)\d{3,4}(&lt;\/.*security&gt;) $1xxxx$2
-(&gt;)\d{11,12}(\d{4}&lt;\/.*:.*creditCardNumber&gt;) $1xxxxxxxxxxxx$2
-(&gt;)\d{3,4}(&lt;\/.*:.*security&gt;) $1xxxx$2
-(>)\d{3,4}(<\/.*cVVCode>) $1xxxx$2
-(&gt;)\d{3,4}(&lt;\/.*cVVCode&gt;) $1xxxx$2
-(&gt;)\d{3,4}(&lt;\/.*:.*cVVCode&gt;) $1xxxx$2
-(&gt;).*(&lt;\/userPassword&gt;) $1xxxxxxx$2
-(&gt;).*(&lt;\/.*:userPassword&gt;) $1xxxxxx$2
-(&gt;).*(&lt;\/userPassword&gt;) $1xxxxxxx$2
-(\"userPassword\"\s*:\s*\")(.*?)(\") $1xxxxxx$3
-(\"cng:userPassword\"\s*:\s*\")(.*?)(\") $1xxxxxx$3
-(\"userPassword\"\s*:\s*)(\d+)(,|\s|}|]) $1xxxxxx$3
-(\"cng:userPassword\"\s*:\s*)(\d+)(,|\s|}|]) $1xxxxxx$3
\ No newline at end of file
diff --git a/ms/controllerblueprints/application/etc/SecurityFilterExpressionsPool.properties b/ms/controllerblueprints/application/etc/SecurityFilterExpressionsPool.properties
deleted file mode 100644 (file)
index acfaa45..0000000
+++ /dev/null
@@ -1,22 +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.
-#
-
-MaxActive=150
-#TimeBetweenEvictionRunsMillis=10
-
-#Min and Max idle are only used if TimeBetweenEvictionRunsMillis is set to a value > 0
-#MaxIdle=10
-#MinIdle=5
diff --git a/ms/controllerblueprints/application/etc/logback.xml b/ms/controllerblueprints/application/etc/logback.xml
deleted file mode 100644 (file)
index 01ae4f6..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<!--\r
-  ~ Copyright © 2017-2018 AT&T Intellectual Property.\r
-  ~\r
-  ~ Licensed under the Apache License, Version 2.0 (the "License");\r
-  ~ you may not use this file except in compliance with the License.\r
-  ~ You may obtain a copy of the License at\r
-  ~\r
-  ~     http://www.apache.org/licenses/LICENSE-2.0\r
-  ~\r
-  ~ Unless required by applicable law or agreed to in writing, software\r
-  ~ distributed under the License is distributed on an "AS IS" BASIS,\r
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-  ~ See the License for the specific language governing permissions and\r
-  ~ limitations under the License.\r
-  -->\r
-\r
-<configuration>\r
-\r
-    <property name="localPattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{100} - %msg%n" />\r
-\r
-    <property name="defaultPattern" value="%date{ISO8601,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Timer}| %msg%n" />\r
-\r
-    <property name="debugLoggerPattern" value="%date{ISO8601,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Timer}|[%caller{3}]| %msg%n" />\r
-\r
-    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">\r
-        <!-- encoders are assigned the type\r
-             ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->\r
-        <encoder>\r
-            <pattern>${defaultPattern}</pattern>\r
-        </encoder>\r
-    </appender>\r
-\r
-\r
-    <logger name="org.springframework" level="info"/>\r
-    <logger name="org.springframework.web" level="info"/>\r
-    <logger name="org.springframework.security.web.authentication" level="warn"/>\r
-    <logger name="org.hibernate" level="error"/>\r
-    <logger name="org.onap.ccsdk.apps" level="info"/>\r
-\r
-    <root level="warn">\r
-        <appender-ref ref="STDOUT"/>\r
-    </root>\r
-\r
-</configuration>\r
diff --git a/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties b/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties
deleted file mode 100755 (executable)
index 1c9029d..0000000
+++ /dev/null
@@ -1,70 +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.
-#
-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=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=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/test-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/opt/app/onap/config/application.properties b/ms/controllerblueprints/application/opt/app/onap/config/application.properties
deleted file mode 100755 (executable)
index 049d846..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# 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.
-# 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=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=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/test-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
index 9a5e75d..1c9029d 100755 (executable)
@@ -49,7 +49,7 @@ 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
+resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability
 # Controller Blueprints Core Configuration
 controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy
 controllerblueprints.blueprintArchivePath=/etc/blueprints/archive
index 0c78936..0340938 100755 (executable)
@@ -1,5 +1,6 @@
 #
 # 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");
@@ -32,16 +33,16 @@ logging.level.org.hibernate.type.descriptor.sql=debug
 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
+swagger.contact.name=CCSDK team
+swagger.contact.url=www.onap.org
+swagger.contact.email=onap-discuss@lists.onap.org
 
 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.url=jdbc:mysql://db:3306/sdnctl
 spring.datasource.username=sdnctl
 spring.datasource.password=sdnctl
 spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
@@ -51,7 +52,7 @@ 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
+resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability
 
 # Controller Blueprints Core Configuration
 controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy
@@ -60,12 +61,12 @@ 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/test-blueprint
+controllerblueprints.loadBluePrint=true
+controllerblueprints.loadBluePrintPaths=/opt/app/onap//model-catalog/blueprint-model/service-blueprint
 controllerblueprints.loadModelType=true
-controllerblueprints.loadModeTypePaths=/model-catalog/definition-type/starter-type
+controllerblueprints.loadModeTypePaths=/opt/app/onap//model-catalog/definition-type/starter-type
 controllerblueprints.loadResourceDictionary=true
-controllerblueprints.loadResourceDictionaryPaths=/model-catalog/resource-dictionary/starter-dictionary
+controllerblueprints.loadResourceDictionaryPaths=/opt/app/onap//model-catalog/resource-dictionary/starter-dictionary
 
 # CBA file extension
 controllerblueprints.loadCbaExtension=zip
old mode 100755 (executable)
new mode 100644 (file)
similarity index 97%
rename from ms/controllerblueprints/application/opt/app/onap/config/logback.xml
rename to ms/controllerblueprints/application/src/main/resources/logback.xml
index 01ae4f6..2db82a1
@@ -1,44 +1,44 @@
-<!--\r
-  ~ Copyright © 2017-2018 AT&T Intellectual Property.\r
-  ~\r
-  ~ Licensed under the Apache License, Version 2.0 (the "License");\r
-  ~ you may not use this file except in compliance with the License.\r
-  ~ You may obtain a copy of the License at\r
-  ~\r
-  ~     http://www.apache.org/licenses/LICENSE-2.0\r
-  ~\r
-  ~ Unless required by applicable law or agreed to in writing, software\r
-  ~ distributed under the License is distributed on an "AS IS" BASIS,\r
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-  ~ See the License for the specific language governing permissions and\r
-  ~ limitations under the License.\r
-  -->\r
-\r
-<configuration>\r
-\r
-    <property name="localPattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{100} - %msg%n" />\r
-\r
-    <property name="defaultPattern" value="%date{ISO8601,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Timer}| %msg%n" />\r
-\r
-    <property name="debugLoggerPattern" value="%date{ISO8601,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Timer}|[%caller{3}]| %msg%n" />\r
-\r
-    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">\r
-        <!-- encoders are assigned the type\r
-             ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->\r
-        <encoder>\r
-            <pattern>${defaultPattern}</pattern>\r
-        </encoder>\r
-    </appender>\r
-\r
-\r
-    <logger name="org.springframework" level="info"/>\r
-    <logger name="org.springframework.web" level="info"/>\r
-    <logger name="org.springframework.security.web.authentication" level="warn"/>\r
-    <logger name="org.hibernate" level="error"/>\r
-    <logger name="org.onap.ccsdk.apps" level="info"/>\r
-\r
-    <root level="warn">\r
-        <appender-ref ref="STDOUT"/>\r
-    </root>\r
-\r
-</configuration>\r
+<!--
+  ~ 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.
+  -->
+
+<configuration>
+
+    <property name="localPattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{100} - %msg%n" />
+
+    <property name="defaultPattern" value="%date{ISO8601,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Timer}| %msg%n" />
+
+    <property name="debugLoggerPattern" value="%date{ISO8601,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Timer}|[%caller{3}]| %msg%n" />
+
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <!-- encoders are assigned the type
+             ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+        <encoder>
+            <pattern>${defaultPattern}</pattern>
+        </encoder>
+    </appender>
+
+
+    <logger name="org.springframework" level="info"/>
+    <logger name="org.springframework.web" level="info"/>
+    <logger name="org.springframework.security.web.authentication" level="warn"/>
+    <logger name="org.hibernate" level="error"/>
+    <logger name="org.onap.ccsdk.apps" level="info"/>
+
+    <root level="warn">
+        <appender-ref ref="STDOUT"/>
+    </root>
+
+</configuration>
index 232bfc0..450a354 100755 (executable)
@@ -22,9 +22,6 @@ services:
     ports:\r
     - "8080:8080"\r
     restart: always\r
-    volumes:\r
-    - ~/share/vm_ms/controllerblueprints/config:/opt/app/onap/config\r
-    - ~/share/vm_ms/controllerblueprints/logs:/logs\r
     environment:\r
       APPLICATIONNAME: ControllerBluePrints\r
       BUNDLEVERSION: 1.0.0\r
index 88577f5..d3e10b7 100755 (executable)
@@ -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
index 1555b43..74dc440 100755 (executable)
@@ -17,8 +17,8 @@
   -->
 
 <assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
-          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">
+  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">
     <!-- create a tar.gz file containing the projects dependencies -->
     <id>${assembly.id}</id>
     <formats>
@@ -27,8 +27,6 @@
     <dependencySets>
         <dependencySet>
             <outputDirectory>/opt/app/onap/lib</outputDirectory>
-            <excludes>
-            </excludes>
         </dependencySet>
     </dependencySets>
     <fileSets>
             <directory>${project.basedir}/../application/src/main/resources</directory>
             <includes>
                 <include>application.properties</include>
+                <include>logback.xml</include>
             </includes>
-            <outputDirectory>./</outputDirectory>
-            <useDefaultExcludes>true</useDefaultExcludes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/docker</directory>
-            <includes>
-                <include>Dockerfile</include>
-                <include>startService.sh</include>
-            </includes>
-            <outputDirectory>./</outputDirectory>
-            <useDefaultExcludes>true</useDefaultExcludes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/../application/src/main/resources</directory>
-            <outputDirectory>src/main/resources</outputDirectory>
-            <useDefaultExcludes>true</useDefaultExcludes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/../application/etc</directory>
-            <outputDirectory>./etc</outputDirectory>
-            <useDefaultExcludes>true</useDefaultExcludes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/../application/opt/app/onap/config</directory>
-            <outputDirectory>./config</outputDirectory>
+            <outputDirectory>/opt/app/onap/config</outputDirectory>
             <useDefaultExcludes>true</useDefaultExcludes>
         </fileSet>
         <fileSet>
             <directory>${project.basedir}/../../../components/model-catalog</directory>
-            <outputDirectory>./model-catalog</outputDirectory>
+            <outputDirectory>/opt/app/onap/model-catalog</outputDirectory>
             <useDefaultExcludes>true</useDefaultExcludes>
+            <excludes>
+                <exclude>${project.basedir}/../../../components/model-catalog/proto-definition</exclude>
+            </excludes>
         </fileSet>
     </fileSets>
 </assembly>
index 84b2e5a..7077c22 100755 (executable)
@@ -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
index fe7929e..f6bde1c 100755 (executable)
@@ -37,22 +37,6 @@ class BluePrintArchiveUtils {
     companion object {
         private val log = LoggerFactory.getLogger(BluePrintArchiveUtils::class.java)
 
-        fun getFileContent(fileName: String): String = runBlocking {
-            async {
-                try {
-                    File(fileName).readText(Charsets.UTF_8)
-                } catch (e: Exception) {
-                    throw BluePrintException("couldn't find file($fileName)")
-                }
-            }.await()
-        }
-
-        fun compress(source: String, destination: String, absolute: Boolean): Boolean {
-            val rootDir = File(source)
-            val saveFile = File(destination)
-            return compress(rootDir, saveFile, absolute)
-        }
-
         /**
          * Create a new Zip from a root directory
          *
@@ -63,11 +47,12 @@ class BluePrintArchiveUtils {
          */
         fun compress(source: File, destination: File, absolute: Boolean): Boolean {
             try {
+                destination.createNewFile()
                 ZipArchiveOutputStream(destination).use {
                     recurseFiles(source, source, it, absolute)
                 }
             } catch (e: Exception) {
-                log.error("Fail to compress folder(:$source) to path(${destination.path}", e)
+                log.error("Fail to compress folder($source) to path(${destination.path}", e)
                 return false
             }
             return true
@@ -100,7 +85,10 @@ class BluePrintArchiveUtils {
                 val zae = ZipArchiveEntry(filename)
                 zae.size = file.length()
                 zaos.putArchiveEntry(zae)
-                FileInputStream(file).use { IOUtils.copy(it, zaos) }
+                FileInputStream(file).use {
+                    IOUtils.copy(it, zaos)
+                    it.close()
+                }
                 zaos.closeArchiveEntry()
             }
         }
@@ -132,16 +120,6 @@ class BluePrintArchiveUtils {
 
             return destinationDir
         }
-
-        /**
-         * Get the first item in directory
-         *
-         * @param zipFile
-         * @return string
-         */
-        fun getFirstItemInDirectory(dir: File): String {
-            return dir.walk().map { it.name }.elementAt(1)
-        }
     }
 
 }
\ No newline at end of file
index 3ba729d..cfde86a 100644 (file)
@@ -41,7 +41,7 @@ abstract class BlueprintCatalogServiceImpl(private val blueprintValidator: BlueP
 
         if (blueprintFile.isDirectory) {
             extractedDirectory = blueprintFile
-            archivedDirectory = File(":$blueprintFile.zip")
+            archivedDirectory = File("$blueprintFile.zip")
             toDeleteDirectory = archivedDirectory
 
             if (!BluePrintArchiveUtils.compress(blueprintFile, archivedDirectory, true)) {
index 4fd66ed..948601c 100644 (file)
@@ -61,7 +61,7 @@ open class BluePrintCatalogLoadService(private val bluePrintCatalogService: Blue
         try {
             bluePrintCatalogService.saveToDatabase(file)
         } catch (e: Exception) {
-            errorBuilder.appendln("Couldn't load DataType(${file.name}: ${e.message}")
+            errorBuilder.appendln("Couldn't load BlueprintModel(${file.name}: ${e.message}")
         }
     }