From 112044f9d9999f7e1e1871e49aba9ba73ce3959e Mon Sep 17 00:00:00 2001 From: wasala Date: Wed, 28 Mar 2018 20:08:54 +0200 Subject: Already addes push Dockerfile image from mvn pov Change-Id: I4411279c34dd0b6b38e283fdfafa4977e7eb4414 Issue-ID: DCAEGEN2-407 Signed-off-by: wasala --- Dockerfile | 15 ---------- pom.xml | 6 ++++ prh-app-server/docker/Dockerfile | 15 ++++++++++ prh-app-server/pom.xml | 35 +++++++++++++++++++++- .../prh/tasks/ScheduledXmlContextITest.java | 4 +-- 5 files changed, 56 insertions(+), 19 deletions(-) delete mode 100644 Dockerfile create mode 100644 prh-app-server/docker/Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 4f1a092c..00000000 --- a/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -#This image is sample template only. -FROM azul/zulu-openjdk:8u152 - -MAINTAINER Przemysław Wąsala "przemyslaw.wasala@nokia.com" - -ADD /prh-app-server/target/prh-app-server.jar /opt/app/Prh/ -WORKDIR /opt/app/Prh - -ENV HOME /opt/app/Prh -ENV JAVA_HOME /usr -#RUN apt-get update && apt-get install -y curl vim - -EXPOSE 8100 - -CMD [ "java", "-jar", "prh-app-server.jar" ] \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8f9e7cb4..9843357e 100644 --- a/pom.xml +++ b/pom.xml @@ -396,6 +396,12 @@ ${immutable.version} provided + + com.spotify + docker-maven-plugin + 1.0.0 + + diff --git a/prh-app-server/docker/Dockerfile b/prh-app-server/docker/Dockerfile new file mode 100644 index 00000000..0f71760a --- /dev/null +++ b/prh-app-server/docker/Dockerfile @@ -0,0 +1,15 @@ +#This image is sample template only. +FROM azul/zulu-openjdk:8u152 + +MAINTAINER Przemysław Wąsala "przemyslaw.wasala@nokia.com" + +ADD /target/prh-app-server.jar /opt/app/Prh/ +WORKDIR /opt/app/Prh + +ENV HOME /opt/app/Prh +ENV JAVA_HOME /usr +#RUN apt-get update && apt-get install -y curl vim + +EXPOSE 8100 + +RUN [ "java", "-jar", "prh-app-server.jar" ] \ No newline at end of file diff --git a/prh-app-server/pom.xml b/prh-app-server/pom.xml index a42caa02..8d07fdd6 100644 --- a/prh-app-server/pom.xml +++ b/prh-app-server/pom.xml @@ -31,7 +31,11 @@ prh-app-server org.onap.dcaegen2.services.prh jar - + + yyyyMMdd'T'HHmmss + ${env.MVN_DOCKERREGISTRY_DAILY} + + @@ -53,6 +57,31 @@ org.onap.dcaegen2.services.prh.MainApp + + + com.spotify + docker-maven-plugin + 1.0.0 + + + ${onap.nexus.dockerregistry.daily}/onap/${project.groupId}.${project.artifactId} + + docker + + + / + ${project.build.directory} + ${project.build.finalName}.jar + + + + ${project.version}-${maven.build.timestamp} + latest + + ${onap.nexus.dockerregistry.daily} + + + @@ -66,6 +95,10 @@ org.springframework.boot spring-boot-starter-webflux + + com.spotify + docker-maven-plugin + diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduledXmlContextITest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduledXmlContextITest.java index 7a3fac63..a27b454c 100644 --- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduledXmlContextITest.java +++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduledXmlContextITest.java @@ -22,8 +22,6 @@ package org.onap.dcaegen2.services.prh.tasks; import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.verify; -import java.time.Duration; -import java.util.concurrent.Callable; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -56,7 +54,7 @@ public class ScheduledXmlContextITest extends AbstractTestNGSpringContextTests { @Test - public void testScheduling() throws InterruptedException { + public void testScheduling() { final ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); executorService.scheduleWithFixedDelay(this::verifyDmaapConsumerTask, 0, WAIT_FOR_SCHEDULING, TimeUnit.SECONDS); } -- cgit 1.2.3-korg