From b77bf2529f15e60c852cf83d5150e75d30068bb0 Mon Sep 17 00:00:00 2001 From: "Claudio D. Gasparini" Date: Thu, 28 Jan 2021 15:36:37 +0100 Subject: Decouple configuration from application - Decouple configuration from application - Generate all 3 types of docker variations Issue-ID: CPS-175 Signed-off-by: Claudio D. Gasparini Change-Id: I1e2e0577c5911f7c79801e4c691d196515dc02a1 --- cps-application/pom.xml | 152 +++++++++++++++++++++ .../src/main/java/org/onap/cps/Application.java | 32 +++++ cps-application/src/main/resources/application.yml | 51 +++++++ cps-bom/pom.xml | 17 ++- cps-dependencies/pom.xml | 14 ++ cps-nf-proxy-rest/pom.xml | 52 ++----- .../java/org/onap/cps/nfproxy/Application.java | 30 ---- .../org/onap/cps/nfproxy/config/NfProxyConfig.java | 6 +- .../nfproxy/rest/controller/NfProxyController.java | 2 +- .../src/main/resources/application.yml | 46 ------- .../cps/nfproxy/config/NfProxyConfigSpec.groovy | 32 ----- .../rest/controller/NfProxyControllerSpec.groovy | 2 +- cps-parent/pom.xml | 30 +--- cps-rest/pom.xml | 64 ++++----- .../src/main/java/org/onap/cps/Application.java | 32 ----- .../main/java/org/onap/cps/config/CpsConfig.java | 7 +- .../cps/rest/controller/AdminRestController.java | 2 +- .../cps/rest/controller/DataRestController.java | 2 +- cps-rest/src/main/resources/application.yml | 51 ------- .../rest/controller/AdminRestControllerSpec.groovy | 2 +- .../exceptions/CpsRestExceptionHandlerSpec.groovy | 2 +- docker-compose/README.md | 16 ++- docker-compose/docker-compose.yml | 14 +- pom.xml | 1 + 24 files changed, 332 insertions(+), 327 deletions(-) create mode 100644 cps-application/pom.xml create mode 100644 cps-application/src/main/java/org/onap/cps/Application.java create mode 100644 cps-application/src/main/resources/application.yml delete mode 100644 cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/Application.java mode change 100755 => 100644 cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/config/NfProxyConfig.java delete mode 100644 cps-nf-proxy-rest/src/main/resources/application.yml delete mode 100644 cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/config/NfProxyConfigSpec.groovy delete mode 100644 cps-rest/src/main/java/org/onap/cps/Application.java delete mode 100644 cps-rest/src/main/resources/application.yml diff --git a/cps-application/pom.xml b/cps-application/pom.xml new file mode 100644 index 0000000000..a159ad883a --- /dev/null +++ b/cps-application/pom.xml @@ -0,0 +1,152 @@ + + + 4.0.0 + + + org.onap.cps + cps-parent + 0.0.1-SNAPSHOT + ../cps-parent/pom.xml + + + cps-application + + + 0.0 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.cloud + spring-cloud-starter-sleuth + + + + + + + + com.google.cloud.tools + jib-maven-plugin + + + package + build + + dockerBuild + + + + deploy + buildAndPush + + build + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + cps-docker + + false + + + + + ${project.groupId} + cps-rest + + + + + + com.google.cloud.tools + jib-maven-plugin + + + + + + xnf-docker + + false + + + + org.onap.cps.Application + nexus3.onap.org:10001/onap/cps-nf-proxy + + + + + ${project.groupId} + cps-nf-proxy-rest + + + + + + com.google.cloud.tools + jib-maven-plugin + + + + + + cps-xnf-docker + + false + + + + org.onap.cps.Application + nexus3.onap.org:10001/onap/cps-and-nf-proxy + + + + + ${project.groupId} + cps-rest + + + ${project.groupId} + cps-nf-proxy-rest + + + + + + com.google.cloud.tools + jib-maven-plugin + + + + + + \ No newline at end of file diff --git a/cps-application/src/main/java/org/onap/cps/Application.java b/cps-application/src/main/java/org/onap/cps/Application.java new file mode 100644 index 0000000000..d8e849d53d --- /dev/null +++ b/cps-application/src/main/java/org/onap/cps/Application.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2020 Nordix Foundation. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.cps; + +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); + } +} \ No newline at end of file diff --git a/cps-application/src/main/resources/application.yml b/cps-application/src/main/resources/application.yml new file mode 100644 index 0000000000..c3ceecde0a --- /dev/null +++ b/cps-application/src/main/resources/application.yml @@ -0,0 +1,51 @@ +server: + port: 8080 + +rest: + api: + cps-base-path: /cps/api + xnf-base-path: /cps-nf-proxy/api + +spring: + main: + banner-mode: "off" + 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 + + cache: + type: caffeine + cache-names: yangSchema + caffeine: + spec: maximumSize=10000,expireAfterAccess=10m +# 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-bom/pom.xml b/cps-bom/pom.xml index cc89de7aa8..3d43f6c5b8 100644 --- a/cps-bom/pom.xml +++ b/cps-bom/pom.xml @@ -33,32 +33,37 @@ - org.onap.cps + ${project.groupId} cps-service ${project.version} - org.onap.cps + ${project.groupId} cps-rest ${project.version} - org.onap.cps + ${project.groupId} cps-nf-proxy-rest ${project.version} - org.onap.cps + ${project.groupId} cps-ri ${project.version} - org.onap.cps + ${project.groupId} + cps-application + ${project.version} + + + ${project.groupId} checkstyle ${project.version} - org.onap.cps + ${project.groupId} spotbugs ${project.version} diff --git a/cps-dependencies/pom.xml b/cps-dependencies/pom.xml index 23683f65c2..1beee115b0 100755 --- a/cps-dependencies/pom.xml +++ b/cps-dependencies/pom.xml @@ -26,6 +26,7 @@ 1.3-groovy-2.5 4.2.0 2.3.8.RELEASE + Hoxton.SR9 3.0.0 2.1.4 1.15.1 @@ -54,6 +55,13 @@ pom import + + org.springframework.cloud + spring-cloud-dependencies + ${springboot.cloud.version} + pom + import + org.opendaylight.yangtools yangtools-artifacts @@ -66,6 +74,12 @@ swagger-annotations ${swagger.version} + + + io.swagger + swagger-annotations + 1.6.2 + io.springfox springfox-boot-starter diff --git a/cps-nf-proxy-rest/pom.xml b/cps-nf-proxy-rest/pom.xml index 7b56014353..ca2cf83452 100755 --- a/cps-nf-proxy-rest/pom.xml +++ b/cps-nf-proxy-rest/pom.xml @@ -12,9 +12,7 @@ cps-nf-proxy-rest - org.onap.cps.nfproxy.Application - nexus3.onap.org:10001/onap/cps-nf-proxy - 0.44 + 0.0 @@ -52,6 +50,10 @@ io.springfox springfox-boot-starter + + io.swagger + swagger-annotations + org.apache.commons commons-lang3 @@ -92,10 +94,6 @@ - - org.springframework.boot - spring-boot-maven-plugin - io.swagger.codegen.v3 @@ -112,44 +110,16 @@ org.onap.cps.nfproxy.rest.api spring false + + src/gen/java + java11 + true + true + - - - - docker - - false - - - - - com.google.cloud.tools - jib-maven-plugin - - - package - build - - dockerBuild - - - - deploy - buildAndPush - - build - - - - - - - - - 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 index abad806e0b..0000000000 --- a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/Application.java +++ /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); - } -} diff --git a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/config/NfProxyConfig.java b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/config/NfProxyConfig.java old mode 100755 new mode 100644 index 3bdedc3631..defe0f19c8 --- a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/config/NfProxyConfig.java +++ b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/config/NfProxyConfig.java @@ -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(); diff --git a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java index 8125c5aed7..99451e69a2 100644 --- a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java +++ b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java @@ -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 index 06c0fd1ea3..0000000000 --- a/cps-nf-proxy-rest/src/main/resources/application.yml +++ /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 index 3eb42d7779..0000000000 --- a/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/config/NfProxyConfigSpec.groovy +++ /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 - } -} diff --git a/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/rest/controller/NfProxyControllerSpec.groovy b/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/rest/controller/NfProxyControllerSpec.groovy index d1c3b1648f..874a1b004e 100644 --- a/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/rest/controller/NfProxyControllerSpec.groovy +++ b/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/rest/controller/NfProxyControllerSpec.groovy @@ -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.'(){ diff --git a/cps-parent/pom.xml b/cps-parent/pom.xml index b8f8975a67..36abc909cc 100755 --- a/cps-parent/pom.xml +++ b/cps-parent/pom.xml @@ -33,7 +33,7 @@ 4.2.0 3.0.18 /content/repositories/snapshots/ - ${project.version} + ${project.version} ${project.reporting.outputDirectory}/jacoco-aggregate @@ -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 @@ -120,27 +122,6 @@ io.swagger.codegen.v3 swagger-codegen-maven-plugin ${swagger-codegen-maven-plugin.version} - - - - generate - - - ${project.basedir}/docs/api/swagger/openapi.yml - org.onap.cps.rest.controller - org.onap.cps.rest.model - org.onap.cps.rest.api - spring - false - - src/gen/java - java11 - true - true - - - - com.google.cloud.tools @@ -155,10 +136,7 @@ ${base.image} - ${repository.name} - - ${tag.version} - + ${repository.name}:${image.version} diff --git a/cps-rest/pom.xml b/cps-rest/pom.xml index 49c3267dd9..6ee0c4fdd1 100755 --- a/cps-rest/pom.xml +++ b/cps-rest/pom.xml @@ -12,7 +12,7 @@ cps-rest - 0.88 + 0.53 @@ -50,6 +50,10 @@ io.springfox springfox-boot-starter + + io.swagger + swagger-annotations + org.apache.commons commons-lang3 @@ -94,48 +98,32 @@ - - org.springframework.boot - spring-boot-maven-plugin - io.swagger.codegen.v3 swagger-codegen-maven-plugin + + + + generate + + + ${project.basedir}/docs/api/swagger/openapi.yml + org.onap.cps.rest.controller + org.onap.cps.rest.model + org.onap.cps.rest.api + spring + false + + src/gen/java + java11 + true + true + + + + - - - - docker - - false - - - - - com.google.cloud.tools - jib-maven-plugin - - - package - build - - dockerBuild - - - - deploy - buildAndPush - - build - - - - - - - - diff --git a/cps-rest/src/main/java/org/onap/cps/Application.java b/cps-rest/src/main/java/org/onap/cps/Application.java deleted file mode 100644 index d8e849d53d..0000000000 --- a/cps-rest/src/main/java/org/onap/cps/Application.java +++ /dev/null @@ -1,32 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2020 Nordix Foundation. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.cps; - -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); - } -} \ No newline at end of file diff --git a/cps-rest/src/main/java/org/onap/cps/config/CpsConfig.java b/cps-rest/src/main/java/org/onap/cps/config/CpsConfig.java index cca5fe7d8d..419a218930 100755 --- a/cps-rest/src/main/java/org/onap/cps/config/CpsConfig.java +++ b/cps-rest/src/main/java/org/onap/cps/config/CpsConfig.java @@ -34,9 +34,12 @@ public class CpsConfig { /** * Swagger configuration. */ - @Bean + @Bean("cps-docket") public Docket api() { - return new Docket(DocumentationType.OAS_30).select().apis(RequestHandlerSelectors.any()) + return new Docket(DocumentationType.OAS_30) + .groupName("cps-docket") + .select() + .apis(RequestHandlerSelectors.any()) .paths(PathSelectors.any()).build(); } diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java index 1b6f56a211..8f4bdb716f 100644 --- a/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java @@ -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 diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java index 2ecbd4f544..61f9399e7e 100644 --- a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java @@ -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 diff --git a/cps-rest/src/main/resources/application.yml b/cps-rest/src/main/resources/application.yml deleted file mode 100644 index 22948c3c30..0000000000 --- a/cps-rest/src/main/resources/application.yml +++ /dev/null @@ -1,51 +0,0 @@ -server: - port: 8080 - -rest: - api: - base-path: /cps/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 - - cache: - type: caffeine - cache-names: yangSchema - caffeine: - spec: maximumSize=10000,expireAfterAccess=10m -# Actuator -management: - endpoints: - web: - base-path: /manage - exposure: - include: health,info,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-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy index 540d6224aa..88adf10efa 100644 --- a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy +++ b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy @@ -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' diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy index edc484b14a..45f6102a2f 100644 --- a/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy +++ b/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy @@ -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 diff --git a/docker-compose/README.md b/docker-compose/README.md index 619b0d4a8d..ca395df07a 100644 --- a/docker-compose/README.md +++ b/docker-compose/README.md @@ -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 diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index 391d91109e..accdbd4dbf 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -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 eaa388cc1c..ab0a459f01 100644 --- a/pom.xml +++ b/pom.xml @@ -36,5 +36,6 @@ cps-ri checkstyle spotbugs + cps-application -- cgit 1.2.3-korg