From 2f7a1b8783367c6804c6599569c72ad7d88ab267 Mon Sep 17 00:00:00 2001 From: "k.kedron" Date: Fri, 16 Apr 2021 14:38:52 +0200 Subject: Configure maven to produce docker images For: - datacollector rapp - sleepingcelldetector rapp Change-Id: If394448cb49d6ab082b37eeb49142cc5529789b7 Issue-ID: INT-1896 Signed-off-by: Krystian Kedron --- datacollector/docker/.maven-dockerinclude | 1 - datacollector/docker/Dockerfile | 3 +- datacollector/pom.xml | 54 +++++++++++++++++++++++++--- pom.xml | 31 +++++++++++++++-- sleepingcelldetector/docker/Dockerfile | 4 +++ sleepingcelldetector/pom.xml | 58 ++++++++++++++++++++++++++++--- 6 files changed, 137 insertions(+), 14 deletions(-) delete mode 100644 datacollector/docker/.maven-dockerinclude create mode 100644 sleepingcelldetector/docker/Dockerfile diff --git a/datacollector/docker/.maven-dockerinclude b/datacollector/docker/.maven-dockerinclude deleted file mode 100644 index fd6cecd..0000000 --- a/datacollector/docker/.maven-dockerinclude +++ /dev/null @@ -1 +0,0 @@ -target/*.jar diff --git a/datacollector/docker/Dockerfile b/datacollector/docker/Dockerfile index 251673d..6d56ac8 100644 --- a/datacollector/docker/Dockerfile +++ b/datacollector/docker/Dockerfile @@ -1,5 +1,4 @@ FROM nexus3.onap.org:10001/onap/integration-java11:8.0.0 -ARG VERSION="" USER root @@ -9,6 +8,6 @@ USER onap EXPOSE 8087 -COPY *-${VERSION}.jar /app/service.jar +COPY datacollector*.jar /app/service.jar COPY init.sql start.sh /app/ ENTRYPOINT ["/bin/sh", "/app/start.sh"] diff --git a/datacollector/pom.xml b/datacollector/pom.xml index 141d212..db59334 100644 --- a/datacollector/pom.xml +++ b/datacollector/pom.xml @@ -28,10 +28,6 @@ 0.0.1-SNAPSHOT - - org.onap.rapp.datacollector - - org.springframework.boot @@ -89,6 +85,56 @@ + + org.apache.maven.plugins + maven-antrun-plugin + 1.8 + + + package + + + + + + + run + + + + + + io.fabric8 + docker-maven-plugin + ${docker-maven-plugin.version} + + + docker-build-image + install + + build + push + + + + + ${skipDockerPush} + true + IfNotPresent + + + ${docker-image.namespace}/${docker-image.name.prefix}/${project.artifactId} + ${docker.registry} + + ${project.basedir}/docker + + ${project.version}-${maven.build.timestamp}Z + + + + + + com.github.kongchen swagger-maven-plugin diff --git a/pom.xml b/pom.xml index 0a2de84..aa41a07 100644 --- a/pom.xml +++ b/pom.xml @@ -27,15 +27,32 @@ - org.springframework.boot - spring-boot-starter-parent - 2.3.0.RELEASE + org.onap.oparent + oparent + 3.2.0 + + + + org.springframework.boot + spring-boot-dependencies + 2.3.0.RELEASE + pom + import + + + + 11 UTF-8 yyyyMMdd'T'HHmmss + true + nexus3.onap.org:10003 + 0.31.0 + onap + integration/usecase/a1-policy-enforcement 1.18.8 2.6.0 @@ -75,6 +92,14 @@ org.apache.maven.plugins maven-dependency-plugin + + io.fabric8 + docker-maven-plugin + ${docker-maven-plugin.version} + + true + + maven-resources-plugin diff --git a/sleepingcelldetector/docker/Dockerfile b/sleepingcelldetector/docker/Dockerfile new file mode 100644 index 0000000..0365146 --- /dev/null +++ b/sleepingcelldetector/docker/Dockerfile @@ -0,0 +1,4 @@ +FROM nexus3.onap.org:10001/onap/integration-java11:8.0.0 + +COPY sleepingcelldetector*.jar /app/service.jar +ENTRYPOINT exec java $JAVA_SEC_OPTS $JAVA_OPTS -jar /app/service.jar diff --git a/sleepingcelldetector/pom.xml b/sleepingcelldetector/pom.xml index 80b790d..0b067f8 100644 --- a/sleepingcelldetector/pom.xml +++ b/sleepingcelldetector/pom.xml @@ -26,10 +26,6 @@ 0.0.1-SNAPSHOT - - org.onap.rapp.sleepingcelldetector - - org.springframework.boot @@ -52,4 +48,58 @@ 28.2-android + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.8 + + + package + + + + + + + run + + + + + + io.fabric8 + docker-maven-plugin + ${docker-maven-plugin.version} + + + docker-build-image + install + + build + push + + + + + ${skipDockerPush} + true + IfNotPresent + + + ${docker-image.namespace}/${docker-image.name.prefix}/${project.artifactId} + ${docker.registry} + + ${project.basedir}/docker + + ${project.version}-${maven.build.timestamp}Z + + + + + + + + -- cgit 1.2.3-korg