diff options
author | k.kedron <k.kedron@partner.samsung.com> | 2021-04-16 14:38:52 +0200 |
---|---|---|
committer | Krystian Kedron <k.kedron@partner.samsung.com> | 2021-04-22 14:03:48 +0000 |
commit | 2f7a1b8783367c6804c6599569c72ad7d88ab267 (patch) | |
tree | 6c0e143b450238890cd53e07c7a9db26838d286a /datacollector | |
parent | 442e160da964c94f39ce8b5b457cb10e96825386 (diff) |
Configure maven to produce docker images
For:
- datacollector rapp
- sleepingcelldetector rapp
Change-Id: If394448cb49d6ab082b37eeb49142cc5529789b7
Issue-ID: INT-1896
Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com>
Diffstat (limited to 'datacollector')
-rw-r--r-- | datacollector/docker/.maven-dockerinclude | 1 | ||||
-rw-r--r-- | datacollector/docker/Dockerfile | 3 | ||||
-rw-r--r-- | datacollector/pom.xml | 54 |
3 files changed, 51 insertions, 7 deletions
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 @@ <version>0.0.1-SNAPSHOT</version> </parent> - <properties> - <docker-image.name.prefix>org.onap.rapp.datacollector</docker-image.name.prefix> - </properties> - <dependencies> <dependency> <groupId>org.springframework.boot</groupId> @@ -90,6 +86,56 @@ <build> <plugins> <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.8</version> + <executions> + <execution> + <phase>package</phase> + <configuration> + <target> + <copy file="target/${project.artifactId}-${project.version}.jar" tofile="./docker/${project.artifactId}-${project.version}.jar"/> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>${docker-maven-plugin.version}</version> + <executions> + <execution> + <id>docker-build-image</id> + <phase>install</phase> + <goals> + <goal>build</goal> + <goal>push</goal> + </goals> + </execution> + </executions> + <configuration> + <skipPush>${skipDockerPush}</skipPush> + <verbose>true</verbose> + <imagePullPolicy>IfNotPresent</imagePullPolicy> + <images> + <image> + <name>${docker-image.namespace}/${docker-image.name.prefix}/${project.artifactId}</name> + <registry>${docker.registry}</registry> + <build> + <dockerFileDir>${project.basedir}/docker</dockerFileDir> + <tags> + <tag>${project.version}-${maven.build.timestamp}Z</tag> + </tags> + </build> + </image> + </images> + </configuration> + </plugin> + <plugin> <groupId>com.github.kongchen</groupId> <artifactId>swagger-maven-plugin</artifactId> <version>${swagger.maven.plugin.version}</version> |