diff options
-rw-r--r-- | .gitignore (renamed from cps/.gitignore) | 0 | ||||
-rw-r--r-- | Dockerfile | 1 | ||||
-rw-r--r-- | cps-dependencies/pom.xml | 9 | ||||
-rw-r--r-- | cps-parent/pom.xml | 42 | ||||
-rw-r--r-- | cps-rest/pom.xml | 9 | ||||
-rw-r--r-- | docker-compose/README.md | 3 | ||||
-rw-r--r-- | docker-compose/docker-compose.yml | 26 |
7 files changed, 87 insertions, 3 deletions
diff --git a/cps/.gitignore b/.gitignore index 624c9b63b..624c9b63b 100644 --- a/cps/.gitignore +++ b/.gitignore diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 81fdf16d3..000000000 --- a/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -FROM openjdk:11-jre-slim
\ No newline at end of file diff --git a/cps-dependencies/pom.xml b/cps-dependencies/pom.xml index ee37b1e0a..f4546a41c 100644 --- a/cps-dependencies/pom.xml +++ b/cps-dependencies/pom.xml @@ -13,6 +13,8 @@ <description>This artifact contains dependencyManagement declarations of upstream versions.</description> <properties> + <cglib-nodep.version>3.1</cglib-nodep.version> + <commons-lang3.version>3.11</commons-lang3.version> <groovy.version>3.0.6</groovy.version> <hibernate-types.version>2.10.0</hibernate-types.version> <spock-core.version>2.0-M2-groovy-3.0</spock-core.version> @@ -66,7 +68,12 @@ <dependency> <groupId>cglib</groupId> <artifactId>cglib-nodep</artifactId> - <version>3.1</version> + <version>${cglib-nodep.version}</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>${commons-lang3.version}</version> </dependency> </dependencies> </dependencyManagement> diff --git a/cps-parent/pom.xml b/cps-parent/pom.xml index 0fe2e101a..ea9c98af6 100644 --- a/cps-parent/pom.xml +++ b/cps-parent/pom.xml @@ -16,10 +16,15 @@ <packaging>pom</packaging> <properties> + <app>org.onap.cps.Application</app> + <base.image>openjdk:11-jre-slim</base.image> <java.version>11</java.version> + <jib-maven-plugin.version>2.6.0</jib-maven-plugin.version> <oparent.version>3.1.0</oparent.version> + <repository.name>nexus3.onap.org:10001/onap/cps-service</repository.name> <spring-boot-maven-plugin.version>2.3.3.RELEASE</spring-boot-maven-plugin.version> <swagger-codegen-maven-plugin.version>3.0.18</swagger-codegen-maven-plugin.version> + <tag.version>${project.version}</tag.version> </properties> <dependencyManagement> @@ -173,6 +178,43 @@ </includes> </configuration> </plugin> + <plugin> + <groupId>com.google.cloud.tools</groupId> + <artifactId>jib-maven-plugin</artifactId> + <version>${jib-maven-plugin.version}</version> + <configuration> + <container> + <mainClass>${app}</mainClass> + <creationTime>USE_CURRENT_TIMESTAMP</creationTime> + </container> + <from> + <image>${base.image}</image> + </from> + <to> + <image>${repository.name}</image> + <tags> + <tag>${tag.version}</tag> + </tags> + </to> + </configuration> + <executions> + <execution> + <phase>package</phase> + <id>build</id> + <goals> + <goal>dockerBuild</goal> + </goals> + </execution> + <!-- FIXME Enable this once migrated to onap, + <execution> + <phase>deploy</phase> + <id>buildAndPush</id> + <goals> + <goal>build</goal> + </goals> + </execution>--> + </executions> + </plugin> </plugins> </build> </project>
\ No newline at end of file diff --git a/cps-rest/pom.xml b/cps-rest/pom.xml index 4f8746a36..fc3e6325e 100644 --- a/cps-rest/pom.xml +++ b/cps-rest/pom.xml @@ -46,7 +46,10 @@ <groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
@@ -82,6 +85,10 @@ <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>com.google.cloud.tools</groupId>
+ <artifactId>jib-maven-plugin</artifactId>
+ </plugin>
<!-- Swagger code generation. -->
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
diff --git a/docker-compose/README.md b/docker-compose/README.md new file mode 100644 index 000000000..d23f03349 --- /dev/null +++ b/docker-compose/README.md @@ -0,0 +1,3 @@ +```bash +VERSION=0.0.1-SNAPSHOT DB_HOST=localhost DB_USERNAME=cps DB_PASSWORD=cps docker-compose up +```
\ No newline at end of file diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml new file mode 100644 index 000000000..6894d3f2c --- /dev/null +++ b/docker-compose/docker-compose.yml @@ -0,0 +1,26 @@ +version: "3.7" + +services: + cps: + restart: unless-stopped + image: nexus3.onap.org:10001/onap/cps-service:${VERSION} + container_name: cps-service + environment: + DB_HOST: ${DB_HOST} + DB_USERNAME: ${DB_USERNAME} + DB_PASSWORD: ${DB_PASSWORD} + ports: + - "8080:8080" + network_mode: "host + depends_on: + - dbpostgresql + + dbpostgresql: + container_name: dbpostgresql + image: postgres + ports: + - '5432:5432' + environment: + DB_NAME: cpsdb + DB_USERNAME: ${DB_USERNAME} + DB_PASSWORD: ${DB_PASSWORD}
\ No newline at end of file |