Modify pom to push policy agent image to nexus 80/2080/3
authorYongchaoWu <yongchao.wu@est.tech>
Thu, 19 Dec 2019 11:53:51 +0000 (12:53 +0100)
committerYongchao Wu <yongchao.wu@est.tech>
Thu, 19 Dec 2019 13:44:10 +0000 (13:44 +0000)
add fabric docker maven plugin
remove spotify dockerfile plugin
run: mvn clean install will generate local image

Issue-ID: NONRTRIC-79
Signed-off-by: YongchaoWu <yongchao.wu@est.tech>
Change-Id: I4db4e4f1ddd3ccb32a77e9862285919bd1f579cc

near-rt-ric-simulator/common/test_env.sh
policy-agent/Dockerfile
policy-agent/pom.xml

index 7861940..0ea885b 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 # Local image and tag, shall point to locally built image (non-nexus path)
-export POLICY_AGENT_LOCAL_IMAGE=oransc/policy-agent
+export POLICY_AGENT_LOCAL_IMAGE=o-ran-sc/policy-agent
 
 
 # Common env var for auto-test.
index 51a4dd3..f28414c 100644 (file)
@@ -17,7 +17,7 @@
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 #
-FROM adoptopenjdk/openjdk11:latest
+FROM openjdk:11-jre-slim
 
 WORKDIR /opt/app/policy-agent
 RUN mkdir -p /var/log/policy-agent
index 0969f14..6ac7978 100644 (file)
@@ -56,7 +56,7 @@
         <junit-platform-surefire-provider.version>1.3.2</junit-platform-surefire-provider.version>
         <formatter-maven-plugin.version>2.8.1</formatter-maven-plugin.version>
         <spotless-maven-plugin.version>1.18.0</spotless-maven-plugin.version>
-        <dockerfile-maven-plugin.version>1.4.13</dockerfile-maven-plugin.version>
+        <docker-maven-plugin>0.30.0</docker-maven-plugin>
     </properties>
     <dependencies>
         <dependency>
                 </executions>
             </plugin>
             <plugin>
-                <groupId>com.spotify</groupId>
-                <artifactId>dockerfile-maven-plugin</artifactId>
-                <version>${dockerfile-maven-plugin.version}</version>
-                <configuration>
-                    <repository>oransc/policy-agent</repository>
-                    <tag>${project.version}</tag>
-                    <buildArgs>
-                        <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
-                    </buildArgs>
-                </configuration>
+                <groupId>io.fabric8</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <version>${docker-maven-plugin}</version>
+                <inherited>false</inherited>
+                <executions>
+                    <execution>
+                        <id>push-policy-agent-image</id>
+                        <goals>
+                            <goal>build</goal>
+                            <goal>push</goal>
+                        </goals>
+                        <configuration>
+                            <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
+                            <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>
+                            <images>
+                                <image>
+                                    <name>o-ran-sc/policy-agent:${project.version}</name>
+                                    <build>
+                                        <contextDir>${basedir}</contextDir>
+                                        <dockerFile>Dockerfile</dockerFile>
+                                        <tags>
+                                            <tag>${project.version}</tag>
+                                        </tags>
+                                    </build>
+                                </image>
+                            </images>
+                        </configuration>
+                    </execution>
+                </executions>
             </plugin>
         </plugins>
     </build>