summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pom.xml6
-rw-r--r--prh-app-server/docker/Dockerfile (renamed from Dockerfile)4
-rw-r--r--prh-app-server/pom.xml35
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduledXmlContextITest.java4
4 files changed, 43 insertions, 6 deletions
diff --git a/pom.xml b/pom.xml
index 8f9e7cb4..9843357e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -396,6 +396,12 @@
<version>${immutable.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+
<!-- LOGGING dependencies> -->
<dependency>
diff --git a/Dockerfile b/prh-app-server/docker/Dockerfile
index 4f1a092c..0f71760a 100644
--- a/Dockerfile
+++ b/prh-app-server/docker/Dockerfile
@@ -3,7 +3,7 @@ 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/
+ADD /target/prh-app-server.jar /opt/app/Prh/
WORKDIR /opt/app/Prh
ENV HOME /opt/app/Prh
@@ -12,4 +12,4 @@ ENV JAVA_HOME /usr
EXPOSE 8100
-CMD [ "java", "-jar", "prh-app-server.jar" ] \ No newline at end of file
+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 @@
<artifactId>prh-app-server</artifactId>
<groupId>org.onap.dcaegen2.services.prh</groupId>
<packaging>jar</packaging>
-
+ <properties>
+ <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
+ <onap.nexus.dockerregistry.daily>${env.MVN_DOCKERREGISTRY_DAILY}
+ </onap.nexus.dockerregistry.daily>
+ </properties>
<build>
<plugins>
<plugin>
@@ -53,6 +57,31 @@
<mainClass>org.onap.dcaegen2.services.prh.MainApp</mainClass>
</configuration>
</plugin>
+ <!-- This plugin may go away in favor of a custom Dockerfile provided by Carsten and co. -->
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <imageName>
+ ${onap.nexus.dockerregistry.daily}/onap/${project.groupId}.${project.artifactId}
+ </imageName>
+ <dockerDirectory>docker</dockerDirectory>
+ <resources>
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${project.build.directory}</directory>
+ <include>${project.build.finalName}.jar</include>
+ </resource>
+ </resources>
+ <imageTags>
+ <imageTag>${project.version}-${maven.build.timestamp}</imageTag>
+ <imageTag>latest</imageTag>
+ </imageTags>
+ <serverId>${onap.nexus.dockerregistry.daily}</serverId>
+ </configuration>
+ </plugin>
+
</plugins>
</build>
<dependencies>
@@ -66,6 +95,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ </dependency>
<!-- LOGGING DEPENDENCIES-->
<dependency>
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);
}