Decouple configuration from application 21/117221/6
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Thu, 28 Jan 2021 14:36:37 +0000 (15:36 +0100)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Mon, 1 Feb 2021 17:08:30 +0000 (18:08 +0100)
- Decouple configuration from application
- Generate all 3 types of docker variations

Issue-ID: CPS-175
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
Change-Id: I1e2e0577c5911f7c79801e4c691d196515dc02a1

22 files changed:
cps-application/pom.xml [new file with mode: 0644]
cps-application/src/main/java/org/onap/cps/Application.java [moved from cps-rest/src/main/java/org/onap/cps/Application.java with 100% similarity]
cps-application/src/main/resources/application.yml [moved from cps-rest/src/main/resources/application.yml with 83% similarity]
cps-bom/pom.xml
cps-dependencies/pom.xml
cps-nf-proxy-rest/pom.xml
cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/Application.java [deleted file]
cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/config/NfProxyConfig.java [changed mode: 0755->0644]
cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java
cps-nf-proxy-rest/src/main/resources/application.yml [deleted file]
cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/config/NfProxyConfigSpec.groovy [deleted file]
cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/rest/controller/NfProxyControllerSpec.groovy
cps-parent/pom.xml
cps-rest/pom.xml
cps-rest/src/main/java/org/onap/cps/config/CpsConfig.java
cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java
cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java
cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy
cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
docker-compose/README.md
docker-compose/docker-compose.yml
pom.xml

diff --git a/cps-application/pom.xml b/cps-application/pom.xml
new file mode 100644 (file)
index 0000000..a159ad8
--- /dev/null
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onap.cps</groupId>
+        <artifactId>cps-parent</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+        <relativePath>../cps-parent/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>cps-application</artifactId>
+
+    <properties>
+        <minimum-coverage>0.0</minimum-coverage>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-sleuth</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>com.google.cloud.tools</groupId>
+                    <artifactId>jib-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <phase>package</phase>
+                            <id>build</id>
+                            <goals>
+                                <goal>dockerBuild</goal>
+                            </goals>
+                        </execution>
+                        <execution>
+                            <phase>deploy</phase>
+                            <id>buildAndPush</id>
+                            <goals>
+                                <goal>build</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+    <profiles>
+        <profile>
+            <id>cps-docker</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+
+            <dependencies>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>cps-rest</artifactId>
+                </dependency>
+            </dependencies>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.google.cloud.tools</groupId>
+                        <artifactId>jib-maven-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>xnf-docker</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+
+            <properties>
+                <app>org.onap.cps.Application</app>
+                <repository.name>nexus3.onap.org:10001/onap/cps-nf-proxy</repository.name>
+            </properties>
+
+            <dependencies>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>cps-nf-proxy-rest</artifactId>
+                </dependency>
+            </dependencies>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.google.cloud.tools</groupId>
+                        <artifactId>jib-maven-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>cps-xnf-docker</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+
+            <properties>
+                <app>org.onap.cps.Application</app>
+                <repository.name>nexus3.onap.org:10001/onap/cps-and-nf-proxy</repository.name><!-- better naming? -->
+            </properties>
+
+            <dependencies>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>cps-rest</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>${project.groupId}</groupId>
+                    <artifactId>cps-nf-proxy-rest</artifactId>
+                </dependency>
+            </dependencies>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.google.cloud.tools</groupId>
+                        <artifactId>jib-maven-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
\ No newline at end of file
@@ -3,12 +3,12 @@ server:
 \r
 rest:\r
     api:\r
-        base-path: /cps/api\r
+        cps-base-path: /cps/api\r
+        xnf-base-path: /cps-nf-proxy/api\r
 \r
 spring:\r
     main:\r
         banner-mode: "off"\r
-# for POC only, later this should move to cpi-ri module\r
     jpa:\r
         ddl-auto: create\r
         open-in-view: false\r
@@ -34,8 +34,8 @@ management:
     endpoints:\r
         web:\r
             base-path: /manage\r
-            exposure:\r
-                include: health,info,loggers\r
+        exposure:\r
+            include: info,health,loggers\r
     endpoint:\r
         health:\r
             show-details: always\r
index cc89de7..3d43f6c 100644 (file)
     <dependencyManagement>
         <dependencies>
             <dependency>
-                <groupId>org.onap.cps</groupId>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>cps-service</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>
-                <groupId>org.onap.cps</groupId>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>cps-rest</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>
-                <groupId>org.onap.cps</groupId>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>cps-nf-proxy-rest</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>
-                <groupId>org.onap.cps</groupId>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>cps-ri</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>
-                <groupId>org.onap.cps</groupId>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>cps-application</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>checkstyle</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>
-                <groupId>org.onap.cps</groupId>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>spotbugs</artifactId>
                 <version>${project.version}</version>
             </dependency>
index 23683f6..1beee11 100755 (executable)
@@ -26,6 +26,7 @@
         <spock-spring.version>1.3-groovy-2.5</spock-spring.version>
         <spotbugs.version>4.2.0</spotbugs.version>
         <springboot.version>2.3.8.RELEASE</springboot.version>
+        <springboot.cloud.version>Hoxton.SR9</springboot.cloud.version>
         <springfox.version>3.0.0</springfox.version>
         <swagger.version>2.1.4</swagger.version>
         <testcontainers.version>1.15.1</testcontainers.version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>${springboot.cloud.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
                 <artifactId>swagger-annotations</artifactId>
                 <version>${swagger.version}</version>
             </dependency>
+            <!---To be removed once swagger-codegen-maven-plugin is upgraded-->
+            <dependency>
+                <groupId>io.swagger</groupId>
+                <artifactId>swagger-annotations</artifactId>
+                <version>1.6.2</version>
+            </dependency>
             <dependency>
                 <groupId>io.springfox</groupId>
                 <artifactId>springfox-boot-starter</artifactId>
index 7b56014..ca2cf83 100755 (executable)
@@ -12,9 +12,7 @@
     <artifactId>cps-nf-proxy-rest</artifactId>
 
     <properties>
-        <app>org.onap.cps.nfproxy.Application</app>
-        <repository.name>nexus3.onap.org:10001/onap/cps-nf-proxy</repository.name>
-        <minimum-coverage>0.44</minimum-coverage>
+        <minimum-coverage>0.0</minimum-coverage>
     </properties>
 
     <dependencies>
             <groupId>io.springfox</groupId>
             <artifactId>springfox-boot-starter</artifactId>
         </dependency>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
 
     <build>
         <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
             <!-- Swagger code generation. -->
             <plugin>
                 <groupId>io.swagger.codegen.v3</groupId>
                             <apiPackage>org.onap.cps.nfproxy.rest.api</apiPackage>
                             <language>spring</language>
                             <generateSupportingFiles>false</generateSupportingFiles>
+                            <configOptions>
+                                <sourceFolder>src/gen/java</sourceFolder>
+                                <dateLibrary>java11</dateLibrary>
+                                <interfaceOnly>true</interfaceOnly>
+                                <useTags>true</useTags>
+                            </configOptions>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
         </plugins>
     </build>
-
-    <profiles>
-        <profile>
-            <id>docker</id>
-            <activation>
-                <activeByDefault>false</activeByDefault>
-            </activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>com.google.cloud.tools</groupId>
-                        <artifactId>jib-maven-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <phase>package</phase>
-                                <id>build</id>
-                                <goals>
-                                    <goal>dockerBuild</goal>
-                                </goals>
-                            </execution>
-                            <execution>
-                                <phase>deploy</phase>
-                                <id>buildAndPush</id>
-                                <goals>
-                                    <goal>build</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
-
 </project>
diff --git a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/Application.java b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/Application.java
deleted file mode 100644 (file)
index abad806..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *  ============LICENSE_START=======================================================
- *  Copyright (C) 2021 Pantheon.tech
- *  ================================================================================
- *  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.
- *
- *  SPDX-License-Identifier: Apache-2.0
- *  ============LICENSE_END=========================================================
- */
-
-package org.onap.cps.nfproxy;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class Application {
-    public static void main(final String[] args) {
-        SpringApplication.run(Application.class, args);
-    }
-}
old mode 100755 (executable)
new mode 100644 (file)
index 3bdedc3..defe0f1
@@ -33,9 +33,11 @@ public class NfProxyConfig {
     /**
      * Swagger-ui configuration.
      */
-    @Bean
+    @Bean("nf-proxy-docket")
     public Docket api() {
-        return new Docket(DocumentationType.OAS_30).select()
+        return new Docket(DocumentationType.OAS_30)
+            .groupName("nf-proxy-docket")
+            .select()
             .apis(RequestHandlerSelectors.any())
             .paths(PathSelectors.any())
             .build();
index 8125c5a..99451e6 100644 (file)
@@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 @RestController
-@RequestMapping("${rest.api.base-path}")
+@RequestMapping("${rest.api.xnf-base-path}")
 public class NfProxyController implements NfProxyApi {
 
     @Override
diff --git a/cps-nf-proxy-rest/src/main/resources/application.yml b/cps-nf-proxy-rest/src/main/resources/application.yml
deleted file mode 100644 (file)
index 06c0fd1..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-server:
-    port: 8080
-
-rest:
-    api:
-        base-path: /cps-nf-proxy/api
-
-spring:
-    main:
-        banner-mode: "off"
-# for POC only, later this should move to cpi-ri module
-    jpa:
-        ddl-auto: create
-        open-in-view: false
-        properties:
-            hibernate:
-                enable_lazy_load_no_trans: true
-                dialect: org.hibernate.dialect.PostgreSQLDialect
-
-    datasource:
-        url: jdbc:postgresql://${DB_HOST}:5432/cpsdb
-        username: ${DB_USERNAME}
-        password: ${DB_PASSWORD}
-        driverClassName: org.postgresql.Driver
-        initialization-mode: always
-
-# Actuator
-management:
-    endpoints:
-        web:
-            base-path: /manage
-        exposure:
-            include: info,health,loggers
-    endpoint:
-        health:
-            show-details: always
-            # kubernetes probes: liveness and readiness
-            probes:
-                enabled: true
-        loggers:
-            enabled: true
-
-logging:
-    level:
-        org:
-            springframework: INFO
diff --git a/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/config/NfProxyConfigSpec.groovy b/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/config/NfProxyConfigSpec.groovy
deleted file mode 100644 (file)
index 3eb42d7..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2021 Pantheon.tech
- *  ================================================================================
- *  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.
- *
- *  SPDX-License-Identifier: Apache-2.0
- *  ============LICENSE_END=========================================================
- */
-package org.onap.cps.nfproxy.config
-
-
-import spock.lang.Specification
-import springfox.documentation.spring.web.plugins.Docket
-
-class NfProxyConfigSpec extends Specification {
-    def objectUnderTest = new NfProxyConfig()
-
-    def 'xNF Proxy configuration has a Docket API'() {
-        expect: 'the CPS configuration has a Docket API'
-            objectUnderTest.api() instanceof Docket
-    }
-}
index d1c3b16..874a1b0 100644 (file)
@@ -33,7 +33,7 @@ class NfProxyControllerSpec extends Specification {
     @Autowired
     MockMvc mvc
 
-    @Value('${rest.api.base-path}')
+    @Value('${rest.api.xnf-base-path}')
     def basePath
 
     def 'Hello world method invocation.'(){
index b8f8975..36abc90 100755 (executable)
@@ -33,7 +33,7 @@
         <spotbugs.version>4.2.0</spotbugs.version>
         <swagger-codegen-maven-plugin.version>3.0.18</swagger-codegen-maven-plugin.version>
         <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
-        <tag.version>${project.version}</tag.version>
+        <image.version>${project.version}</image.version>
 
         <jacoco.reportDirectory.aggregate>${project.reporting.outputDirectory}/jacoco-aggregate</jacoco.reportDirectory.aggregate>
         <sonar.coverage.jacoco.xmlReportPaths>
@@ -45,6 +45,8 @@
             ../cps-rest/target/site/jacoco-aggregate/jacoco.xml,
             ../cps-nf-proxy-rest/target/site/jacoco-ut/jacoco.xml,
             ../cps-nf-proxy-rest/target/site/jacoco-aggregate/jacoco.xml,
+            ../cps-application/target/site/jacoco-ut/jacoco.xml,
+            ../cps-application/target/site/jacoco-aggregate/jacoco.xml
         </sonar.coverage.jacoco.xmlReportPaths>
     </properties>
 
                     <groupId>io.swagger.codegen.v3</groupId>
                     <artifactId>swagger-codegen-maven-plugin</artifactId>
                     <version>${swagger-codegen-maven-plugin.version}</version>
-                    <executions>
-                        <execution>
-                            <goals>
-                                <goal>generate</goal>
-                            </goals>
-                            <configuration>
-                                <inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec>
-                                <invokerPackage>org.onap.cps.rest.controller</invokerPackage>
-                                <modelPackage>org.onap.cps.rest.model</modelPackage>
-                                <apiPackage>org.onap.cps.rest.api</apiPackage>
-                                <language>spring</language>
-                                <generateSupportingFiles>false</generateSupportingFiles>
-                                <configOptions>
-                                    <sourceFolder>src/gen/java</sourceFolder>
-                                    <dateLibrary>java11</dateLibrary>
-                                    <interfaceOnly>true</interfaceOnly>
-                                    <useTags>true</useTags>
-                                </configOptions>
-                            </configuration>
-                        </execution>
-                    </executions>
                 </plugin>
                 <plugin>
                     <groupId>com.google.cloud.tools</groupId>
                             <image>${base.image}</image>
                         </from>
                         <to>
-                            <image>${repository.name}</image>
-                            <tags>
-                                <tag>${tag.version}</tag>
-                            </tags>
+                            <image>${repository.name}:${image.version}</image>
                         </to>
                     </configuration>
                 </plugin>
index 49c3267..6ee0c4f 100755 (executable)
@@ -12,7 +12,7 @@
     <artifactId>cps-rest</artifactId>\r
 \r
     <properties>\r
-        <minimum-coverage>0.88</minimum-coverage>\r
+        <minimum-coverage>0.53</minimum-coverage>\r
     </properties>\r
 \r
     <dependencies>\r
             <groupId>io.springfox</groupId>\r
             <artifactId>springfox-boot-starter</artifactId>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>io.swagger</groupId>\r
+            <artifactId>swagger-annotations</artifactId>\r
+        </dependency>\r
         <dependency>\r
             <groupId>org.apache.commons</groupId>\r
             <artifactId>commons-lang3</artifactId>\r
 \r
     <build>\r
         <plugins>\r
-            <plugin>\r
-                <groupId>org.springframework.boot</groupId>\r
-                <artifactId>spring-boot-maven-plugin</artifactId>\r
-            </plugin>\r
             <!-- Swagger code generation. -->\r
             <plugin>\r
                 <groupId>io.swagger.codegen.v3</groupId>\r
                 <artifactId>swagger-codegen-maven-plugin</artifactId>\r
+                <executions>\r
+                    <execution>\r
+                        <goals>\r
+                            <goal>generate</goal>\r
+                        </goals>\r
+                        <configuration>\r
+                            <inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec>\r
+                            <invokerPackage>org.onap.cps.rest.controller</invokerPackage>\r
+                            <modelPackage>org.onap.cps.rest.model</modelPackage>\r
+                            <apiPackage>org.onap.cps.rest.api</apiPackage>\r
+                            <language>spring</language>\r
+                            <generateSupportingFiles>false</generateSupportingFiles>\r
+                            <configOptions>\r
+                                <sourceFolder>src/gen/java</sourceFolder>\r
+                                <dateLibrary>java11</dateLibrary>\r
+                                <interfaceOnly>true</interfaceOnly>\r
+                                <useTags>true</useTags>\r
+                            </configOptions>\r
+                        </configuration>\r
+                    </execution>\r
+                </executions>\r
             </plugin>\r
         </plugins>\r
     </build>\r
-\r
-    <profiles>\r
-        <profile>\r
-            <id>docker</id>\r
-            <activation>\r
-                <activeByDefault>false</activeByDefault>\r
-            </activation>\r
-            <build>\r
-                <plugins>\r
-                    <plugin>\r
-                        <groupId>com.google.cloud.tools</groupId>\r
-                        <artifactId>jib-maven-plugin</artifactId>\r
-                        <executions>\r
-                            <execution>\r
-                                <phase>package</phase>\r
-                                <id>build</id>\r
-                                <goals>\r
-                                    <goal>dockerBuild</goal>\r
-                                </goals>\r
-                            </execution>\r
-                            <execution>\r
-                                <phase>deploy</phase>\r
-                                <id>buildAndPush</id>\r
-                                <goals>\r
-                                    <goal>build</goal>\r
-                                </goals>\r
-                            </execution>\r
-                        </executions>\r
-                    </plugin>\r
-                </plugins>\r
-            </build>\r
-        </profile>\r
-    </profiles>\r
 </project>\r
index cca5fe7..419a218 100755 (executable)
@@ -34,9 +34,12 @@ public class CpsConfig {
     /**\r
      * Swagger configuration.\r
      */\r
-    @Bean\r
+    @Bean("cps-docket")\r
     public Docket api() {\r
-        return new Docket(DocumentationType.OAS_30).select().apis(RequestHandlerSelectors.any())\r
+        return new Docket(DocumentationType.OAS_30)\r
+            .groupName("cps-docket")\r
+            .select()\r
+            .apis(RequestHandlerSelectors.any())\r
             .paths(PathSelectors.any()).build();\r
     }\r
 \r
index 1b6f56a..8f4bdb7 100644 (file)
@@ -38,7 +38,7 @@ import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
 @RestController
-@RequestMapping("${rest.api.base-path}")
+@RequestMapping("${rest.api.cps-base-path}")
 public class AdminRestController implements CpsAdminApi {
 
     @Autowired
index 2ecbd4f..61f9399 100644 (file)
@@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
 @RestController
-@RequestMapping("${rest.api.base-path}")
+@RequestMapping("${rest.api.cps-base-path}")
 public class DataRestController implements CpsDataApi {
 
     @Autowired
index 540d622..88adf10 100644 (file)
@@ -61,7 +61,7 @@ class AdminRestControllerSpec extends Specification {
     @Autowired
     MockMvc mvc
 
-    @Value('${rest.api.base-path}')
+    @Value('${rest.api.cps-base-path}')
     def basePath
 
     def anchorsEndpoint = '/v1/dataspaces/my_dataspace/anchors'
index edc484b..45f6102 100644 (file)
@@ -61,7 +61,7 @@ class CpsRestExceptionHandlerSpec extends Specification {
     @Autowired
     MockMvc mvc
 
-    @Value('${rest.api.base-path}')
+    @Value('${rest.api.cps-base-path}')
     def basePath
 
     @Shared
index 619b0d4..ca395df 100644 (file)
@@ -1,7 +1,19 @@
-# Docker Compose
+# Docker Compose deployment example for local enviroments, CPS deployment is done via OOM
 
 To run the application locally using `docker-compose`, execute following command from this `docker-compose` folder:
 
+Generate the containers
+
+```bash
+mvn clean install -Pcps-docker -Pxnf-docker -Pcps-xnf-docker
+```
+or for generate an specific type
+
+```bash
+mvn clean install -Pcps-docker
+```
+Run the containers
+
 ```bash
-VERSION=0.0.1-SNAPSHOT DB_HOST=dbpostgresql DB_USERNAME=cps DB_PASSWORD=cps docker-compose up
+VERSION=0.0.1-SNAPSHOT DB_HOST=dbpostgresql DB_USERNAME=cps DB_PASSWORD=cps docker-compose up -d
 ```
\ No newline at end of file
index 391d911..accdbd4 100644 (file)
@@ -5,7 +5,7 @@ services:
     container_name: cps-service
     image: nexus3.onap.org:10001/onap/cps-service:${VERSION}
     ports:
-      - "8080:8080"
+      - "8881:8080"
     environment:
       DB_HOST: ${DB_HOST}
       DB_USERNAME: ${DB_USERNAME}
@@ -14,18 +14,6 @@ services:
     depends_on:
       - dbpostgresql
 
-  cps-nf-proxy:
-    container_name: cps-nf-proxy
-    image: nexus3.onap.org:10001/onap/cps-nf-proxy:${VERSION}
-    ports:
-      - "8081:8080"
-    environment:
-      DB_HOST: ${DB_HOST}
-      DB_USERNAME: ${DB_USERNAME}
-      DB_PASSWORD: ${DB_PASSWORD}
-    restart: unless-stopped
-    depends_on:
-      - dbpostgresql
 
   dbpostgresql:
     container_name: dbpostgresql
diff --git a/pom.xml b/pom.xml
index eaa388c..ab0a459 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -36,5 +36,6 @@
         <module>cps-ri</module>\r
         <module>checkstyle</module>\r
         <module>spotbugs</module>\r
+        <module>cps-application</module>\r
     </modules>\r
 </project>\r